Package org.languagetool.language

Examples of org.languagetool.language.French


public class FrenchRuleDisambiguator extends AbstractRuleDisambiguator {
   
  @Override
  protected Language getLanguage() {
    return new French();
  }
View Full Code Here


  private GenericUnpairedBracketsRule rule;
  private JLanguageTool langTool;
 
  public void testFrenchRule() throws IOException {
    setUpRule(new French());
    // correct sentences:
    assertMatches("(Qu'est ce que c'est ?)", 0);
    // incorrect sentences:
    assertMatches("(Qu'est ce que c'est ?", 1);
  }
View Full Code Here

public class HunspellRuleTest {

  @Test
  public void testRuleWithFrench() throws Exception {
    final French french = new French();
    final HunspellRule rule = new HunspellRule(TestTools.getMessages("French"), 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

    tokenizer = new WordTokenizer();
    sentenceTokenizer = new SentenceTokenizer();
    disambiguator = new FrenchRuleDisambiguator();
    disamb2 = new DemoDisambiguator();   
    try {
      lt = new JLanguageTool(new French());
    } catch (IOException e) {
      fail(e.getMessage());
    }
  }
View Full Code Here

    tagger = new FrenchTagger();
    tokenizer = new WordTokenizer();
  }

  public void testDictionary() throws IOException {
    TestTools.testDictionary(tagger, new French());
  }
View Full Code Here

public class FrenchConcurrencyTest extends AbstractLanguageConcurrencyTest {

  @Override
  protected Language createLanguage() {
    return new French();
  }
View Full Code Here

    tagger = new FrenchTagger();
    tokenizer = new WordTokenizer();
  }

  public void testDictionary() throws IOException {
    TestTools.testDictionary(tagger, new French());
  }
View Full Code Here

public class QuestionWhitespaceRuleTest extends TestCase {

    public final void testRule() throws IOException {
      QuestionWhitespaceRule rule = new QuestionWhitespaceRule(TestTools.getEnglishMessages());
      RuleMatch[] matches;
      JLanguageTool langTool = new JLanguageTool(new French());
     
      // correct sentences:
      assertEquals(0, rule.match(langTool.getAnalyzedSentence("C'est vrai !")).length);
      assertEquals(0, rule.match(langTool.getAnalyzedSentence("Qu'est ce que c'est ?")).length);
      assertEquals(0, rule.match(langTool.getAnalyzedSentence("L'enjeu de ce livre est donc triple : philosophique")).length);
View Full Code Here

 
  @Override
  public void setUp() throws IOException {
    tagger = new FrenchTagger();
    tokenizer = new WordTokenizer();
    French language = new French();
    sentenceTokenizer = new SRXSentenceTokenizer(language);
    disambiguator = new XmlRuleDisambiguator(language);
    disamb2 = new DemoDisambiguator();   
    lt = new JLanguageTool(language);
  }
View Full Code Here

  private GenericUnpairedBracketsRule rule;
  private JLanguageTool langTool;
 
  public void testFrenchRule() throws IOException {
    setUpRule(new French());
    // correct sentences:
    assertMatches("(Qu'est ce que c'est ?)", 0);
    // incorrect sentences:
    assertMatches("(Qu'est ce que c'est ?", 1);
  }
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.