Package org.languagetool

Examples of org.languagetool.JLanguageTool.check()


  public void testRule() throws IOException {
    JLanguageTool langTool = new JLanguageTool(new German());
    // correct sentences:
    assertEquals(0, langTool.check("Er ist nett. Er heißt Max.").size());
    assertEquals(0, langTool.check("Außerdem kommt er. Ferner kommt sie. Außerdem kommt es.").size());
    assertEquals(0, langTool.check("2011: Dieses passiert. 2011: Jenes passiert. 2011: Nicht passiert").size());
    // errors:
    assertEquals(1, langTool.check("Er ist nett. Er heißt Max. Er ist 11.").size());
    assertEquals(1, langTool.check("Außerdem kommt er. Außerdem kommt sie.").size());
    // this used to cause false alarms because reset() was not implemented
View Full Code Here


  public void testRule() throws IOException {
    JLanguageTool langTool = new JLanguageTool(new German());
    // correct sentences:
    assertEquals(0, langTool.check("Er ist nett. Er heißt Max.").size());
    assertEquals(0, langTool.check("Außerdem kommt er. Ferner kommt sie. Außerdem kommt es.").size());
    assertEquals(0, langTool.check("2011: Dieses passiert. 2011: Jenes passiert. 2011: Nicht passiert").size());
    // errors:
    assertEquals(1, langTool.check("Er ist nett. Er heißt Max. Er ist 11.").size());
    assertEquals(1, langTool.check("Außerdem kommt er. Außerdem kommt sie.").size());
    // this used to cause false alarms because reset() was not implemented
    assertEquals(0, langTool.check("Außerdem ist das ein neuer Text.").size());
View Full Code Here

    // correct sentences:
    assertEquals(0, langTool.check("Er ist nett. Er heißt Max.").size());
    assertEquals(0, langTool.check("Außerdem kommt er. Ferner kommt sie. Außerdem kommt es.").size());
    assertEquals(0, langTool.check("2011: Dieses passiert. 2011: Jenes passiert. 2011: Nicht passiert").size());
    // errors:
    assertEquals(1, langTool.check("Er ist nett. Er heißt Max. Er ist 11.").size());
    assertEquals(1, langTool.check("Außerdem kommt er. Außerdem kommt sie.").size());
    // this used to cause false alarms because reset() was not implemented
    assertEquals(0, langTool.check("Außerdem ist das ein neuer Text.").size());
  }
View Full Code Here

    assertEquals(0, langTool.check("Er ist nett. Er heißt Max.").size());
    assertEquals(0, langTool.check("Außerdem kommt er. Ferner kommt sie. Außerdem kommt es.").size());
    assertEquals(0, langTool.check("2011: Dieses passiert. 2011: Jenes passiert. 2011: Nicht passiert").size());
    // errors:
    assertEquals(1, langTool.check("Er ist nett. Er heißt Max. Er ist 11.").size());
    assertEquals(1, langTool.check("Außerdem kommt er. Außerdem kommt sie.").size());
    // this used to cause false alarms because reset() was not implemented
    assertEquals(0, langTool.check("Außerdem ist das ein neuer Text.").size());
  }

}
View Full Code Here

    assertEquals(0, langTool.check("2011: Dieses passiert. 2011: Jenes passiert. 2011: Nicht passiert").size());
    // errors:
    assertEquals(1, langTool.check("Er ist nett. Er heißt Max. Er ist 11.").size());
    assertEquals(1, langTool.check("Außerdem kommt er. Außerdem kommt sie.").size());
    // this used to cause false alarms because reset() was not implemented
    assertEquals(0, langTool.check("Außerdem ist das ein neuer Text.").size());
  }

}
View Full Code Here

        try {
          JLanguageTool tool = new JLanguageTool(this.language);
          tool.activateDefaultPatternRules();
          tool.activateDefaultFalseFriendRules();
         
          Assert.assertNotNull(tool.check(this.sampleText));
        } catch (Exception e) {         
          failedTests += 1;
         
          // Force a log message and the debugger to pause.
          throw new RuntimeException(e);
View Full Code Here

public class UppercaseSentenceStartRuleTest extends TestCase {

  public void testDutchSpecialCases() throws IOException {
    final JLanguageTool lt = new JLanguageTool(new Dutch());
   
    assertEquals(1, lt.check("A sentence.").size());
    assertEquals(0, lt.check("'s Morgens...").size());

    assertEquals(2, lt.check("a sentence.").size());
    assertEquals(1, lt.check("'s morgens...").size());
    assertEquals(2, lt.check("s sentence.").size());
View Full Code Here

  public void testDutchSpecialCases() throws IOException {
    final JLanguageTool lt = new JLanguageTool(new Dutch());
   
    assertEquals(1, lt.check("A sentence.").size());
    assertEquals(0, lt.check("'s Morgens...").size());

    assertEquals(2, lt.check("a sentence.").size());
    assertEquals(1, lt.check("'s morgens...").size());
    assertEquals(2, lt.check("s sentence.").size());
  }
View Full Code Here

    final JLanguageTool lt = new JLanguageTool(new Dutch());
   
    assertEquals(1, lt.check("A sentence.").size());
    assertEquals(0, lt.check("'s Morgens...").size());

    assertEquals(2, lt.check("a sentence.").size());
    assertEquals(1, lt.check("'s morgens...").size());
    assertEquals(2, lt.check("s sentence.").size());
  }
 
}
View Full Code Here

   
    assertEquals(1, lt.check("A sentence.").size());
    assertEquals(0, lt.check("'s Morgens...").size());

    assertEquals(2, lt.check("a sentence.").size());
    assertEquals(1, lt.check("'s morgens...").size());
    assertEquals(2, lt.check("s sentence.").size());
  }
 
}
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.