Package org.languagetool

Examples of org.languagetool.JLanguageTool.disableRule()


  private JLanguageTool getLanguageToolForSpellCheck(Language language) {
    JLanguageTool lt = new JLanguageTool(language);
    for (Rule rule : lt.getAllActiveRules()) {
      if (!rule.isDictionaryBasedSpellingRule()) {
        lt.disableRule(rule.getId());
      }
    }
    return lt;
  }
View Full Code Here


            "Did you mean <suggestion>typoh</suggestion>?", null);
    langTool.addRule(ruleWithSuggestion);
    final List<RuleMatch> matches2 = langTool.check("This is a typoh.");
    assertEquals(0, matches2.size());   // no error anymore, as this is a suggestion

    langTool.disableRule("TEST_ID");
    final List<RuleMatch> matches3 = langTool.check("This is a typoh.");
    assertEquals(1, matches3.size());   // an error again
  }

}
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.