This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void collectSourceTermStatsCRCCExt(String itemType) { | |
ArrayList<String> allTokens = new ArrayList<>(); | |
ArrayList<String> srcFiles = new ArrayList<>(); | |
for (String fileURL : this.results) { | |
// avoid other files than Java | |
if (!fileURL.endsWith(".java")) | |
continue; | |
String fileName = new File(fileURL).getName(); | |
// String activeURL = this.repoFolder + "/" + fileName; | |
int index = Integer.parseInt(fileName.split("\\.")[0]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package developer.experience; | |
import java.util.ArrayList; | |
import java.util.Date; | |
import java.util.HashMap; | |
import org.json.simple.JSONArray; | |
import org.json.simple.JSONObject; | |
import json.loader.RepoPRJSONLoader; | |
import repo.commit.loader.RepoCommitMapLoader; | |
import config.StaticData; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package malletwork; | |
import cc.mallet.types.*; | |
import cc.mallet.pipe.*; | |
import cc.mallet.pipe.iterator.*; | |
import cc.mallet.topics.*; | |
import java.util.*; | |
import java.util.regex.*; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\ccsdesc[500]{Software and its engineering~Software verification and validation} | |
\ccsdesc[500]{Software and its engineering~Software testing and debugging} | |
%\ccsdesc[300]{Software and its engineering~Software defect analysis} | |
%\ccsdesc[100]{Software and its engineering~Software maintenance tools} | |
%\printccsdesc | |
%\terms{Theory, Metrics, Human factors} | |
\keywords{Debugging automation, bug localization, bug report quality, query reformulation, information retrieval, graph-based term weighting} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package lucenecheck; | |
import java.io.BufferedReader; | |
import java.io.File; | |
import java.io.FileInputStream; | |
import java.io.FileNotFoundException; | |
import java.io.IOException; | |
import java.io.InputStreamReader; | |
import java.io.UnsupportedEncodingException; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
\begin{table} | |
\centering | |
\caption{\textbf{Comparison with Popular Web/Code Search Engines}}\label{table:comparison-se} | |
%\vspace{-.2cm} | |
\resizebox{3.6in}{!}{% | |
\begin{threeparttable} | |
\begin{tabular}{l|c|c|c|c} | |
\hline | |
\textbf{Technique} & \textbf{Hit@10} & \textbf{MAP@10} & \textbf{MRR@10} & \textbf{NDCG@10}\\ | |
\hline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public HashMap<String, Double> calculateIDFOnly() { | |
IndexReader reader = null; | |
HashMap<String, Double> inverseDFMap = new HashMap<>(); | |
try { | |
reader = DirectoryReader.open(FSDirectory | |
.open(new File(indexFolder).toPath())); | |
// String targetTerm = "breakpoint"; | |
Fields fields = MultiFields.getFields(reader); | |
for (String field : fields) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static final String FIELD_CONTENTS = "contents"; | |
public HashMap<String, Long> calculateTF() { | |
HashMap<String, Long> termFreqMap = new HashMap<>(); | |
try { | |
IndexReader reader = DirectoryReader.open(FSDirectory | |
.open(new File(indexFolder).toPath())); | |
// String targetTerm = "breakpoint"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DocumentBuilderFactory docFactory = DocumentBuilderFactory | |
.newInstance(); | |
DocumentBuilder docBuilder = docFactory.newDocumentBuilder(); | |
// root elements | |
Document doc = docBuilder.newDocument(); | |
Element rootElement = doc.createElement("bugrepository"); | |
rootElement.setAttribute("name", repoName); | |
doc.appendChild(rootElement); | |
for (BugEntry bentry : entries) { | |
Element bugElement = doc.createElement("bug"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
File myFile = new File(fileName); | |
if(!myFile.exists()){ | |
System.err.println("File does not exist: "+ fileName); | |
} | |
BufferedReader reader = new BufferedReader(new FileReader(myFile)); | |
while (reader.ready()) { | |
String line = reader.readLine(); | |
content += line + "\n"; | |
} |