Search in sources :

Example 1 with Asturian

use of org.languagetool.language.Asturian in project languagetool by languagetool-org.

the class MorfologikAsturianSpellerRuleTest method testMorfologikSpeller.

@Test
public void testMorfologikSpeller() throws IOException {
    Asturian language = new Asturian();
    MorfologikAsturianSpellerRule rule = new MorfologikAsturianSpellerRule(TestTools.getMessages("en"), language);
    JLanguageTool langTool = new JLanguageTool(language);
    assertEquals(0, rule.match(langTool.getAnalyzedSentence("¿Festeyate colos correutores gramaticales?")).length);
    RuleMatch[] matches = rule.match(langTool.getAnalyzedSentence("¿Afáyeste colos correutores gramaticales?"));
    assertEquals(1, matches.length);
    assertEquals(1, matches[0].getFromPos());
    assertEquals(9, matches[0].getToPos());
    assertEquals("Afayesti", matches[0].getSuggestedReplacements().get(0));
}
Also used : RuleMatch(org.languagetool.rules.RuleMatch) Asturian(org.languagetool.language.Asturian) JLanguageTool(org.languagetool.JLanguageTool) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)1 JLanguageTool (org.languagetool.JLanguageTool)1 Asturian (org.languagetool.language.Asturian)1 RuleMatch (org.languagetool.rules.RuleMatch)1