Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scidetect
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Cyril Labbe
scidetect
Commits
573a63ac
Commit
573a63ac
authored
Mar 18, 2015
by
Tien
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Hot fix short text bug
parent
f4acfdaf
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
26 additions
and
17 deletions
+26
-17
readme~
detaillogs/readme~
+0
-0
ThresholdsSet.java
src/fr/imag/forge/scidetect/Checker/Utils/ThresholdsSet.java
+1
-1
TextProcessor.java
src/fr/imag/forge/scidetect/Corpus/TextProcessor.java
+16
-9
SciDetect_Local.java
...imag/forge/scidetect/SciDetect_local/SciDetect_Local.java
+9
-7
No files found.
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
Markdown
is supported
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