Search in sources :

Example 1 with AustrianGerman

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

the class GermanSpellerRuleTest method testRuleWithAustrianGerman.

// note: copied from HunspellRuleTest
@Test
public void testRuleWithAustrianGerman() throws Exception {
    AustrianGerman language = new AustrianGerman();
    HunspellRule rule = new GermanSpellerRule(TestTools.getMessages("de"), language);
    JLanguageTool lt = new JLanguageTool(language);
    commonGermanAsserts(rule, lt);
    // umlauts
    assertEquals(0, rule.match(lt.getAnalyzedSentence("Der äußere Übeltäter.")).length);
    assertEquals(1, rule.match(lt.getAnalyzedSentence("Der äussere Übeltäter.")).length);
}
Also used : HunspellRule(org.languagetool.rules.spelling.hunspell.HunspellRule) JLanguageTool(org.languagetool.JLanguageTool) AustrianGerman(org.languagetool.language.AustrianGerman) Test(org.junit.Test)

Example 2 with AustrianGerman

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

the class HunspellRuleTest method testRuleWithAustrianGerman.

@Test
public void testRuleWithAustrianGerman() throws Exception {
    HunspellRule rule = new HunspellRule(TestTools.getMessages("de"), new AustrianGerman());
    JLanguageTool langTool = new JLanguageTool(new German());
    commonGermanAsserts(rule, langTool);
    // umlauts
    assertEquals(0, rule.match(langTool.getAnalyzedSentence("Der äußere Übeltäter.")).length);
    assertEquals(1, rule.match(langTool.getAnalyzedSentence("Der äussere Übeltäter.")).length);
}
Also used : JLanguageTool(org.languagetool.JLanguageTool) SwissGerman(org.languagetool.language.SwissGerman) AustrianGerman(org.languagetool.language.AustrianGerman) German(org.languagetool.language.German) GermanyGerman(org.languagetool.language.GermanyGerman) AustrianGerman(org.languagetool.language.AustrianGerman) Test(org.junit.Test)

Aggregations

Test (org.junit.Test)2 JLanguageTool (org.languagetool.JLanguageTool)2 AustrianGerman (org.languagetool.language.AustrianGerman)2 German (org.languagetool.language.German)1 GermanyGerman (org.languagetool.language.GermanyGerman)1 SwissGerman (org.languagetool.language.SwissGerman)1 HunspellRule (org.languagetool.rules.spelling.hunspell.HunspellRule)1