Commit 1393f590 authored by Tien's avatar Tien

Fixed minor bugs

parent 05c78f85
......@@ -26,7 +26,7 @@ jar:
cp SciDetect_Local`date +%Y-%m-%d`.jar SciDetect_Local.jar
run:
java -jar SciDetect_local.jar -l checklog.txt -c Test
java -jar SciDetect_Local`date +%Y-%m-%d`.jar -l checklog.txt -c Test
clean:
rm -r classes; rm -r doc;
No preview for this file type
application.args=-c /home/tien/Test_demo/xml/2978-3-319-20608-0_Book_PrintPDF.pdf -d -noclean
application.args=-c /home/tien/Downloads/ReSciDetect/119514_1371359.pdf -noclean
compile.on.save=true
do.depend=false
do.jar=true
......
......@@ -2,10 +2,6 @@
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
<group>
<file>file:/home/tien/NetBeansProjects/ScigenChecker_Local/src/fr/imag/forge/scidetect/Checker/Utils/DistancesSet.java</file>
<file>file:/home/tien/NetBeansProjects/ScigenChecker_Local/src/fr/imag/forge/scidetect/Logger/Log.java</file>
<file>file:/home/tien/NetBeansProjects/ScigenChecker_Local/src/fr/imag/forge/scidetect/scigenchecker_local/ScigenChecker_Local.java</file>
</group>
<group/>
</open-files>
</project-private>
......@@ -72,6 +72,7 @@ public class Reader {
}
}
}
br.close();
}
......@@ -90,6 +91,7 @@ public class Reader {
readsamples(listOfFile[j].getPath());
} else if (listOfFile[j].getName().endsWith(".pdf") || listOfFile[j].getName().endsWith(".xml") || listOfFile[j].getName().endsWith(".xtx") || (listOfFile[j].getName().endsWith(".txt") && !listOfFile[j].getName().startsWith("INDEX-"))) {
ArrayList<Text> text = new ArrayList<Text>();
// System.out.println(listOfFile[j].getName());
TextProcessor textprocessor = new TextProcessor();
text = textprocessor.newtext(listOfFile[j], listOfFile);
for (int i = 0; i < text.size(); i++) {
......@@ -109,9 +111,9 @@ public class Reader {
* @return test corpus
* @throws IOException
*/
public Corpus readtests(String foldername, Corpus Samplecorpus, Boolean savedetaillog) throws IOException {
public String readtests(String foldername, Corpus Samplecorpus, Boolean savedetaillog) throws IOException {
File folder = new File(foldername);
String conclusion = new String();
if (folder.isDirectory()) {
File[] listOfFile = folder.listFiles();
for (int j = 0; j < listOfFile.length; j++) {
......@@ -125,18 +127,7 @@ public class Reader {
for (int i = 0; i < text.size(); i++) {
test.put(text.get(i));
}
DistancesSet distant = new DistancesSet();
DistantCalculator dc = new DistantCalculator();
distant = dc.caldistant(Samplecorpus, test);
Classifier cl = new Classifier();
String conclusion = cl.classify(distant);
System.out.println(conclusion);
Log log = new Log();
log.savelog(conclusion);
if (savedetaillog) {
log.savedetaillog(distant);
}
}
}
......@@ -150,20 +141,21 @@ public class Reader {
for (int i = 0; i < text.size(); i++) {
test.put(text.get(i));
}
DistancesSet distant = new DistancesSet();
DistantCalculator dc = new DistantCalculator();
distant = dc.caldistant(Samplecorpus, test);
Classifier cl = new Classifier();
String conclusion = cl.classify(distant);
System.out.println(conclusion);
Log log = new Log();
log.savelog(conclusion);
if (savedetaillog) {
log.savedetaillog(distant);
}
}
DistancesSet distant = new DistancesSet();
DistantCalculator dc = new DistantCalculator();
distant = dc.caldistant(Samplecorpus, test);
Classifier cl = new Classifier();
conclusion = cl.classify(distant);
System.out.println(conclusion);
Log log = new Log();
log.savelog(conclusion);
if (savedetaillog) {
log.savedetaillog(distant);
}
return test;
return conclusion;
}
......
......@@ -62,7 +62,7 @@ public class TextProcessor {
+ original.getName().substring(0,
original.getName().lastIndexOf("."))
+ ".txt";
String content = "";
String content = null;
if (Arrays.asList(listOfFile).toString().contains(indexname)) {
// System.out.println("lets read from index file");
......
......@@ -44,7 +44,7 @@ public class SciDetect_Local {
private String testpath;
//private String logtime;
public Corpus samples = new Corpus();
private Corpus tests = new Corpus();
//private Corpus tests = new Corpus();
private String SamplesFolder;
//private HashMap<String, HashMap<String, Double>> distant = new HashMap<String, HashMap<String, Double>>();
DistancesSet distant = new DistancesSet();
......@@ -102,7 +102,7 @@ public class SciDetect_Local {
reader.readconfig();
samples = reader.readsamples(SamplesFolder);
tests = reader.readtests(testpath, samples, savedetaillog);
conclusion=reader.readtests(testpath, samples, savedetaillog);
} catch (Exception e) {
System.out.println("* Something went wrong during:");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment