Skip to content

Commit

Permalink
prepare testing neural network rules
Browse files Browse the repository at this point in the history
  • Loading branch information
danielnaber committed Dec 29, 2017
1 parent 526fb7e commit 9cea451
Showing 1 changed file with 5 additions and 3 deletions.
Expand Up @@ -53,10 +53,12 @@ private void run(String languageCode, File textFile) throws IOException {
int endIndex = Math.min(beginIndex + MAX_TEXT_LENGTH, text.length()-1); int endIndex = Math.min(beginIndex + MAX_TEXT_LENGTH, text.length()-1);
String subText = text.substring(beginIndex, endIndex); String subText = text.substring(beginIndex, endIndex);
long startTime = System.currentTimeMillis(); long startTime = System.currentTimeMillis();
MultiThreadedJLanguageTool langTool = new MultiThreadedJLanguageTool(language); MultiThreadedJLanguageTool lt = new MultiThreadedJLanguageTool(language);
List<RuleMatch> matches = langTool.check(subText); //lt.activateWord2VecModelRules(new File("/home/dnaber/lt/word2vec"));
List<RuleMatch> matches = lt.check(subText);
//System.out.println(matches);
long runTime = System.currentTimeMillis() - startTime; long runTime = System.currentTimeMillis() - startTime;
langTool.shutdown(); lt.shutdown();
if (i >= SKIP) { if (i >= SKIP) {
totalTime += runTime; totalTime += runTime;
System.out.println("Time: " + runTime + "ms (" + matches.size() + " matches)"); System.out.println("Time: " + runTime + "ms (" + matches.size() + " matches)");
Expand Down

0 comments on commit 9cea451

Please sign in to comment.