Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Cyril Labbe
scidetect
Commits
573a63ac
Commit
573a63ac
authored
Mar 18, 2015
by
Tien
Browse files
Hot fix short text bug
parent
f4acfdaf
Changes
4
Hide whitespace changes
Inline
Side-by-side
detaillogs/readme~
deleted
100644 → 0
View file @
f4acfdaf
src/fr/imag/forge/scidetect/Checker/Utils/ThresholdsSet.java
View file @
573a63ac
...
...
@@ -8,7 +8,7 @@ import java.io.FileReader;
import
java.io.IOException
;
import
java.util.HashMap
;
/**
* @author
* @author
Nguyen Minh Tien minh-tien.nguyen@imag.fr
*/
public
class
ThresholdsSet
extends
HashMap
<
String
,
Double
[]>
{
...
...
src/fr/imag/forge/scidetect/Corpus/TextProcessor.java
View file @
573a63ac
...
...
@@ -46,7 +46,8 @@ public class TextProcessor {
ArrayList
<
Text
>
text
=
new
ArrayList
<
Text
>();
/**
* Process a File (pdf,xml) to create clean set of text (incase of need to split)
* Process a File (pdf,xml) to create clean set of text (incase of need to
* split)
*
* @param original file
* @param listOfFile
...
...
@@ -78,7 +79,7 @@ public class TextProcessor {
content
=
a
.
xmlextract
(
original
);
}
//lets deal with long file over here
//lets deal with long file over here
//split content and the index part by part
if
(
content
.
length
()
<
maxlength
)
{
...
...
@@ -112,11 +113,13 @@ public class TextProcessor {
return
text
;
}
/**
* Read the index file if it is avaiable
* @param path to the index file
* @return hashmap of indexs
*/
/**
* Read the index file if it is avaiable
*
* @param path to the index file
* @return hashmap of indexs
*/
private
HashMap
<
String
,
Integer
>
readindexfile
(
String
path
)
throws
IOException
{
File
index
=
new
File
(
path
);
BufferedReader
br
;
...
...
@@ -153,8 +156,12 @@ public class TextProcessor {
lower
=
upper
;
upper
=
content
.
length
();
part
[
i
]
=
(
content
.
substring
(
lower
,
upper
));
if
(
content
.
substring
(
lower
,
upper
).
length
()
<
maxlength
/
3
)
{
part
[
i
-
1
]
=
part
[
i
-
1
]
+
content
.
substring
(
lower
,
upper
);
part
=
Arrays
.
copyOf
(
part
,
part
.
length
-
1
);
}
else
{
part
[
i
]
=
(
content
.
substring
(
lower
,
upper
));
}
}
return
part
;
}
...
...
src/fr/imag/forge/scidetect/SciDetect_local/SciDetect_Local.java
View file @
573a63ac
...
...
@@ -81,9 +81,13 @@ public class SciDetect_Local {
}
/**
* This should be where all the components be called,
* It can be used as an interface for a stand alone SciDetect API library.
* @throws IOException
*/
private
void
compute
()
throws
IOException
{
public
void
compute
(
String
[]
args
)
throws
IOException
{
readconfig
();
readargs
(
args
);
if
(
testpath
!=
null
)
{
DateFormat
dateFormat
=
new
SimpleDateFormat
(
"HH:mm dd.MM.yyyy"
);
Date
date
=
new
Date
();
...
...
@@ -147,14 +151,14 @@ public class SciDetect_Local {
}
/**
* To print usage (-h)
* To print usage (-h)
.
*/
private
static
void
printUsage
()
{
System
.
out
.
println
(
"***** Scigen & Co Checker \n"
);
System
.
out
.
println
(
"To test all files in a directory <pathToFilesDirToTest>:"
);
System
.
out
.
println
(
"java -jar Sci
genChecker
_local.jar -l <pathToLogFile> -c <pathToFilesDirToTest> \n"
);
System
.
out
.
println
(
"java -jar Sci
Detect
_local.jar -l <pathToLogFile> -c <pathToFilesDirToTest> \n"
);
System
.
out
.
println
(
"To print usage:"
);
System
.
out
.
println
(
"java -jar Sci
genChecker
_local.jar -h \n"
);
System
.
out
.
println
(
"java -jar Sci
Detect
_local.jar -h \n"
);
System
.
out
.
println
(
"***** \n"
);
}
...
...
@@ -171,9 +175,7 @@ public class SciDetect_Local {
public
static
void
main
(
String
[]
args
)
throws
IOException
{
SciDetect_Local
a
=
new
SciDetect_Local
();
a
.
readconfig
();
a
.
readargs
(
args
);
a
.
compute
();
a
.
compute
(
args
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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