Package org.languagetool.language

Examples of org.languagetool.language.German


    assertEquals("English", new English().getTranslatedName(TestTools.getMessages("en")));
    assertEquals("English (British)", new BritishEnglish().getTranslatedName(TestTools.getMessages("en")));

    assertEquals("Englisch", new English().getTranslatedName(TestTools.getMessages("de")));
    assertEquals("Englisch (Großbritannien)", new BritishEnglish().getTranslatedName(TestTools.getMessages("de")));
    assertEquals("Deutsch", new German().getTranslatedName(TestTools.getMessages("de")));
    assertEquals("Deutsch (Schweiz)", new SwissGerman().getTranslatedName(TestTools.getMessages("de")));
  }
View Full Code Here


  }

  @Test
  public void testGetShortNameWithVariant() {
    assertEquals("en-US", new AmericanEnglish().getShortNameWithCountryAndVariant());
    assertEquals("de", new German().getShortNameWithCountryAndVariant());
  }
View Full Code Here

  }

  @Test
  public void testEqualsConsiderVariantIfSpecified() {
    // every language equals itself:
    assertTrue(new German().equalsConsiderVariantsIfSpecified(new German()));
    assertTrue(new GermanyGerman().equalsConsiderVariantsIfSpecified(new GermanyGerman()));
    assertTrue(new English().equalsConsiderVariantsIfSpecified(new English()));
    assertTrue(new AmericanEnglish().equalsConsiderVariantsIfSpecified(new AmericanEnglish()));
    // equal if variant is the same, but only if specified:
    assertTrue(new AmericanEnglish().equalsConsiderVariantsIfSpecified(new English()));
    assertTrue(new English().equalsConsiderVariantsIfSpecified(new AmericanEnglish()));

    assertFalse(new AmericanEnglish().equalsConsiderVariantsIfSpecified(new BritishEnglish()));
    assertFalse(new English().equalsConsiderVariantsIfSpecified(new German()));
  }
View Full Code Here

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:
    assertEquals(0, rule.match(langTool.getAnalyzedSentence("Unter http://foo.org/bar steht was.")).length);
View Full Code Here

  }

  @Test
  public void testRuleWithAustrianGerman() throws Exception {
    final HunspellRule rule = new HunspellRule(TestTools.getMessages("de"), new AustrianGerman());
    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);
  }
View Full Code Here

  }

  @Test
  public void testRuleWithSwissGerman() throws Exception {
    final HunspellRule rule = new HunspellRule(TestTools.getMessages("de"), new SwissGerman());
    final JLanguageTool langTool = new JLanguageTool(new German());
    commonGermanAsserts(rule, langTool);
    assertEquals(1, rule.match(langTool.getAnalyzedSentence("Der äußere Übeltäter.")).length)// ß not allowed in Swiss
    assertEquals(0, rule.match(langTool.getAnalyzedSentence("Der äussere Übeltäter.")).length)// ss is used instead of ß
  }
View Full Code Here

  private CaseRule rule;
  private JLanguageTool langTool;

  @Override
  public void setUp() throws IOException {
    rule = new CaseRule(null, new German());
    langTool = new JLanguageTool(new German());
  }
View Full Code Here

    rule = new CaseRule(null, new German());
    langTool = new JLanguageTool(new German());
  }

  public void testRuleActivation() throws IOException {
    CaseRule rule = new CaseRule(null, new German());
    assertTrue(rule.supportsLanguage(new German()));
  }
View Full Code Here

  private JLanguageTool langTool;
  private GermanWrongWordInContextRule rule;
 
  @Override
  public void setUp() throws IOException {
    langTool = new JLanguageTool(new German());
    rule = new GermanWrongWordInContextRule(null);
  }
View Full Code Here

public class DashRuleTest extends TestCase {

  private final DashRule rule = new DashRule(null);

  public void testRule() throws IOException {
    JLanguageTool lt = new JLanguageTool(new German());

    // correct sentences:
    assertGood("Die große Diäten-Erhöhung kam dann doch.", lt);
    assertGood("Die große Diätenerhöhung kam dann doch.", lt);
    assertGood("Die große Diäten-Erhöhungs-Manie kam dann doch.", lt);
View Full Code Here

TOP

Related Classes of org.languagetool.language.German

Copyright © 2018 www.massapicom. 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.