use of org.languagetool.language.Tagalog in project languagetool by languagetool-org.
the class MorfologikTagalogSpellerRuleTest method testMorfologikSpeller.
@Test
public void testMorfologikSpeller() throws IOException {
Tagalog language = new Tagalog();
MorfologikTagalogSpellerRule rule = new MorfologikTagalogSpellerRule(TestTools.getMessages("en"), language);
JLanguageTool langTool = new JLanguageTool(language);
assertEquals(0, rule.match(langTool.getAnalyzedSentence("Ang talatang ito ay nagpapakita ng ng kakayahan ng LanguageTool at halimbawa kung paano ito gamitin.")).length);
RuleMatch[] matches = rule.match(langTool.getAnalyzedSentence("Ang talatang ito ay nagpapakita ng ng kakayahan ng LanguageTool at hinahalimbawa kung paano ito gamitin."));
assertEquals(1, matches.length);
assertEquals(67, matches[0].getFromPos());
assertEquals(80, matches[0].getToPos());
assertEquals("hina halimbawa", matches[0].getSuggestedReplacements().get(0));
}
Aggregations