Examples of analyzeText()


Examples of org.languagetool.JLanguageTool.analyzeText()

  private void run(String filename) throws IOException {
    Map<String, ConfusionProbabilityRule.ConfusionSet> confusionSet = getConfusionSet();
    try (FileReader reader = new FileReader(filename)) {
      String text = StringTools.readerToString(reader);
      JLanguageTool languageTool = new JLanguageTool(new English());
      List<AnalyzedSentence> analyzedSentences = languageTool.analyzeText(text);
      for (AnalyzedSentence sentence : analyzedSentences) {
        runOnSentence(sentence, confusionSet);
      }
    }
    System.out.println("Homophones set: " + confusionSet.size() + " items");
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.