Examples of GermanyGerman


Examples of org.languagetool.language.GermanyGerman

import java.util.List;

public class SpellingCheckRuleTest extends TestCase {

  public void testIgnoreSuggestionsWithHunspell() throws IOException {
    final JLanguageTool langTool = new JLanguageTool(new GermanyGerman());

    final List<RuleMatch> matches = langTool.check("Das ist ein einPseudoWortFürLanguageToolTests");
    assertEquals(0, matches.size());   // no error, as this word is in ignore.txt

    final List<RuleMatch> matches2 = langTool.check("Das ist ein Tibbfehla");
View Full Code Here

Examples of org.languagetool.language.GermanyGerman

    assertEquals(1, matches2.size());
    Assert.assertEquals(GermanSpellerRule.RULE_ID, matches2.get(0).getRule().getId());
  }

  public void testIgnoreSuggestionsWithDynamicHunspellRule() throws IOException {
    final JLanguageTool langTool = new JLanguageTool(new GermanyGerman());
    final SpellingCheckRule rule = new HunspellNoSuggestionRule(TestTools.getEnglishMessages(), new GermanyGerman());
    langTool.addRule(rule);
    langTool.disableRule(GermanSpellerRule.RULE_ID);
    final List<RuleMatch> matches = langTool.check("Das ist ein Tibbfehla.");
    assertEquals(1, matches.size());
    assertEquals(HunspellNoSuggestionRule.RULE_ID, matches.get(0).getRule().getId());

    final PatternRule ruleWithSuggestion = new PatternRule("TEST_ID", new GermanyGerman(),
            Collections.<Element>emptyList(), "description",
            "Meinten Sie <suggestion>Tibbfehla</suggestion>?", null);
    langTool.addRule(ruleWithSuggestion);
    final List<RuleMatch> matches2 = langTool.check("Das ist ein Tibbfehla.");
    assertEquals(0, matches2.size());   // no error anymore, as this is a suggestion
View Full Code Here

Examples of org.languagetool.language.GermanyGerman

public class HunspellRuleTest {

  @Test
  public void testRuleWithGerman() throws Exception {
    final HunspellRule rule = new HunspellRule(TestTools.getMessages("de"), new GermanyGerman());
    final JLanguageTool langTool = new JLanguageTool(new German());
    commonGermanAsserts(rule, langTool);
    assertEquals(0, rule.match(langTool.getAnalyzedSentence("Der äußere Übeltäter.")).length)// umlauts
    assertEquals(1, rule.match(langTool.getAnalyzedSentence("Der äussere Übeltäter.")).length);
    // ignore URLs:
View Full Code Here

Examples of org.languagetool.language.GermanyGerman

  public void testCompoundAwareRulePerformance() throws IOException {
    final ResourceBundle messages = ResourceBundle.getBundle("org.languagetool.MessagesBundle", new Locale("de"));
    //slow:
    //final HunspellRule rule = new HunspellRule(messages, Language.GERMANY_GERMAN);
    //fast:
    final CompoundAwareHunspellRule rule = new GermanSpellerRule(messages, new GermanyGerman());
    rule.init();
    final String[] words = {"foo", "warmup", "Rechtschreipreform", "Theatrekasse", "Zoobesuck", "Handselvertreter", "Mückenstick", "gewönlich", "Traprennen", "Autoverkehrr"};
    for (String word : words) {
      final long startTime = System.currentTimeMillis();
      final List<String> suggest = rule.getSuggestions(word);
View Full Code Here

Examples of org.languagetool.language.GermanyGerman

import org.languagetool.language.GermanyGerman;

public class GermanyGermanConcurrencyTest extends AbstractLanguageConcurrencyTest {
  @Override
  protected Language createLanguage() {
    return new GermanyGerman();
  }
View Full Code Here

Examples of org.languagetool.language.GermanyGerman

    //test unknown words listing
    assertEquals("[I, can, description, detailed, give, more, you]", tool.getUnknownWords().toString());   
  }

  public void testGermanyGerman() throws IOException {
    final JLanguageTool tool = new JLanguageTool(new GermanyGerman());
    assertEquals(0, tool.check("Ein Test, der keine Fehler geben sollte.").size());
    assertEquals(1, tool.check("Ein Test Test, der Fehler geben sollte.").size());
    tool.activateDefaultPatternRules();
    tool.setListUnknownWords(true);
    // German rule has no effect with English error, but they are spelling mistakes:
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.