Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Due to inactivity, this project is scheduled to be deleted on 2035-04-24.
Why is this scheduled?
Open sidebar
Cyril Labbe
scidetect
Commits
1393f590
Commit
1393f590
authored
Sep 29, 2016
by
Tien
Browse files
Fixed minor bugs
parent
05c78f85
Changes
7
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
1393f590
...
...
@@ -26,7 +26,7 @@ jar:
cp
SciDetect_Local
`
date
+%Y-%m-%d
`
.jar SciDetect_Local.jar
run
:
java
-jar
SciDetect_
l
ocal.jar
-l
checklog.txt
-c
Test
java
-jar
SciDetect_
L
ocal
`
date
+%Y-%m-%d
`
.jar
-l
checklog.txt
-c
Test
clean
:
rm
-r
classes
;
rm
-r
doc
;
SciDetect_Local.jar
View file @
1393f590
No preview for this file type
nbproject/private/private.properties
View file @
1393f590
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
...
...
nbproject/private/private.xml
View file @
1393f590
...
...
@@ -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>
src/fr/imag/forge/scidetect/Checker/Reader.java
View file @
1393f590
...
...
@@ -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
;
}
...
...
src/fr/imag/forge/scidetect/Corpus/TextProcessor.java
View file @
1393f590
...
...
@@ -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");
...
...
src/fr/imag/forge/scidetect/SciDetect_local/SciDetect_Local.java
View file @
1393f590
...
...
@@ -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:"
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment