Examples of enableRule()


Examples of org.languagetool.JLanguageTool.enableRule()

    assertEquals(1, matches.length);
  }
 
  public void testMultipleSentences() throws IOException {
    final JLanguageTool tool = new JLanguageTool(new English());
    tool.enableRule("EN_UNPAIRED_BRACKETS");

    List<RuleMatch> matches;
    matches = tool
        .check("This is multiple sentence text that contains a bracket: "
            + "[This is bracket. With some text.] and this continues.\n");
View Full Code Here

Examples of org.languagetool.JLanguageTool.enableRule()

    assertEquals(1, matches.length);
  }
 
  public void testMultipleSentences() throws IOException {
    final JLanguageTool tool = new JLanguageTool(new Catalan());
    tool.enableRule("CA_UNPAIRED_BRACKETS");

    List<RuleMatch> matches;
    matches = tool
        .check("Aquesta és una sentència múltiple amb claudàtors: "
            + "[Ací hi ha un claudàtor. Amb algun text.] i ací continua.\n");
View Full Code Here

Examples of org.languagetool.JLanguageTool.enableRule()

    long prevCleanRunTime = -1;
    for (int i = steps; i > 0; i--) {
      int targetActiveRules = ruleNumber / i;
      deactivateAllRules(langTool);
      for (Rule rule : langTool.getAllRules()) {
        langTool.enableRule(rule.getId());
        if (langTool.getAllActiveRules().size() > targetActiveRules) {
          break;
        }
      }
      int activeRules = langTool.getAllActiveRules().size();
View Full Code Here

Examples of org.languagetool.JLanguageTool.enableRule()

  public void testRule() throws IOException {
    final JLanguageTool lt = new JLanguageTool(new German());
    for (Rule rule : lt.getAllActiveRules()) {
      lt.disableRule(rule.getId());
    }
    lt.enableRule("UPPERCASE_SENTENCE_START");
   
    assertEquals(2, lt.check("etwas beginnen. und der auch nicht").size());
   
    assertEquals(0, lt.check("Dies ist ein Satz. Und hier kommt noch einer").size());
    assertEquals(0, lt.check("Dies ist ein Satz. Ätsch, noch einer mit Umlaut.").size());
View Full Code Here

Examples of org.languagetool.JLanguageTool.enableRule()

    assertEquals(1, matches.length);
  }
 
  public void testMultipleSentences() throws IOException {
    final JLanguageTool tool = new JLanguageTool(new Catalan());
    tool.enableRule("CA_UNPAIRED_BRACKETS");

    List<RuleMatch> matches;
    matches = tool
        .check("Aquesta és una sentència múltiple amb claudàtors: "
            + "[Ací hi ha un claudàtor. Amb algun text.] i ací continua.\n");
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.