Package org.languagetool.language

Examples of org.languagetool.language.French


public class HunspellRuleTest {

  @Test
  public void testRuleWithFrench() throws Exception {
    final French french = new French();
    final HunspellRule rule = new HunspellRule(TestTools.getMessages("fr"), french);
    final JLanguageTool langTool = new JLanguageTool(french);

    assertEquals(0, rule.match(langTool.getAnalyzedSentence("Un test simple.")).length);
    assertEquals(1, rule.match(langTool.getAnalyzedSentence("Un test simpple.")).length);
View Full Code Here


    assertEquals(2, rule.match(langTool.getAnalyzedSentence("L’allemagne et l’italie.")).length);
  }

  @Test
  public void testImmunizedFrenchWord() throws Exception {
    final French french = new French();
    final HunspellRule rule = new HunspellRule(TestTools.getMessages("fr"), french);
    JLanguageTool langTool = new JLanguageTool(french);

    assertEquals(1, rule.match(langTool.getAnalyzedSentence("languageTool est génial.")).length);

    final French frenchWithDisambiguator = new French(){
      @Override
      public Disambiguator getDisambiguator() {
        return new TestFrenchDisambiguator();
      }
    };
View Full Code Here

TOP

Related Classes of org.languagetool.language.French

Copyright © 2018 www.massapicom. 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.