use of org.languagetool.language.GermanyGerman in project languagetool by languagetool-org.
the class HunspellRuleTest method testRuleWithGerman.
@Test
public void testRuleWithGerman() throws Exception {
HunspellRule rule = new HunspellRule(TestTools.getMessages("de"), new GermanyGerman());
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);
// ignore URLs:
assertEquals(0, rule.match(langTool.getAnalyzedSentence("Unter http://foo.org/bar steht was.")).length);
assertEquals(1, rule.match(langTool.getAnalyzedSentence("dasdassda http://foo.org/bar steht was.")).length);
assertEquals(1, rule.match(langTool.getAnalyzedSentence("Unter http://foo.org/bar steht dasdassda.")).length);
}
use of org.languagetool.language.GermanyGerman in project languagetool by languagetool-org.
the class SpellingCheckRuleTest method testIgnoreSuggestionsWithHunspell.
@Test
public void testIgnoreSuggestionsWithHunspell() throws IOException {
JLanguageTool lt = new JLanguageTool(new GermanyGerman());
// no error, as this word is in ignore.txt
assertThat(lt.check("Das ist ein einPseudoWortFürLanguageToolTests").size(), is(0));
List<RuleMatch> matches = lt.check("Das ist ein Tibbfehla");
assertThat(matches.size(), is(1));
assertThat(matches.get(0).getRule().getId(), is(GermanSpellerRule.RULE_ID));
}
use of org.languagetool.language.GermanyGerman in project languagetool by languagetool-org.
the class JLanguageToolTest method testCleanOverlappingWithGerman.
@Test
public void testCleanOverlappingWithGerman() throws IOException {
JLanguageTool tool = new JLanguageTool(new GermanyGerman());
// Juxtaposed errors in "TRGS - Technische" should not be removed.
List<RuleMatch> matches = tool.check("TRGS - Technische Regeln für Gefahrstoffe");
assertEquals(3, matches.size());
}
use of org.languagetool.language.GermanyGerman in project languagetool by languagetool-org.
the class AgreementRuleTest method testRegression.
@Test
public void testRegression() throws IOException {
JLanguageTool lt = new JLanguageTool(new GermanyGerman());
// used to be not detected > 1.0.1:
String str = "Und so.\r\nDie Bier.";
List<RuleMatch> matches = lt.check(str);
assertEquals(1, matches.size());
}
use of org.languagetool.language.GermanyGerman in project languagetool by languagetool-org.
the class AgreementRuleTest method setUp.
@Before
public void setUp() throws IOException {
rule = new AgreementRule(TestTools.getMessages("de"), new GermanyGerman());
lt = new JLanguageTool(new GermanyGerman());
}
Aggregations