@@ -0,0 +1,2816 @@
+/* JLanguageTool, a natural language style checker %0A * Copyright (C) 2005 Daniel Naber (http://www.danielnaber.de)%0A * %0A * This library is free software; you can redistribute it and/or%0A * modify it under the terms of the GNU Lesser General Public%0A * License as published by the Free Software Foundation; either%0A * version 2.1 of the License, or (at your option) any later version.%0A *%0A * This library is distributed in the hope that it will be useful,%0A * but WITHOUT ANY WARRANTY; without even the implied warranty of%0A * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU%0A * Lesser General Public License for more details.%0A *%0A * You should have received a copy of the GNU Lesser General Public%0A * License along with this library; if not, write to the Free Software%0A * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301%0A * USA%0A */%0Apackage de.danielnaber.languagetool.rules.de;%0A%0Aimport java.io.IOException;%0A%0Aimport de.danielnaber.languagetool.JLanguageTool;%0Aimport de.danielnaber.languagetool.Language;%0Aimport junit.framework.TestCase;%0A%0A/**%0A * @author Daniel Naber%0A */%0Apublic class AgreementRuleTest extends TestCase %7B%0A%0A  public void testRule() throws IOException %7B%0A    AgreementRule rule = new AgreementRule();%0A    JLanguageTool langTool = new JLanguageTool(Language.GERMAN);%0A%0A    // correct sentences:%0A    assertEquals(0, rule.match(langTool.getAnalyzedSentence(%22Das ist der riesige Tisch.%22)).length);%0A    assertEquals(0, rule.match(langTool.getAnalyzedSentence(%22Der riesige Tisch ist gro%C3%9F.%22)).length);%0A    assertEquals(0, rule.match(langTool.getAnalyzedSentence(%22Die Kanten der der riesigen Tische.%22)).length);%0A    assertEquals(0, rule.match(langTool.getAnalyzedSentence(%22Den riesigen Tisch mag er.%22)).length);%0A    assertEquals(0, rule.match(langTool.getAnalyzedSentence(%22Es mag den riesigen Tisch.%22)).length);%0A    assertEquals(0, rule.match(langTool.getAnalyzedSentence(%22Die Kante des riesigen Tisches.%22)).length);%0A    assertEquals(0, rule.match(langTool.getAnalyzedSentence(%22Dem riesigen Tisch fehlt was.%22)).length);%0A    assertEquals(0, rule.match(langTool.getAnalyzedSentence(%22Die riesigen Tische sind gro%C3%9F.%22)).length);%0A    assertEquals(0, rule.match(langTool.getAnalyzedSentence(%22Der riesigen Tische wegen.%22)).length);%0A%0A    // incorrect sentences:%0A    assertEquals(1, rule.match(langTool.getAnalyzedSentence(%22Es sind die riesigen Tisch.%22)).length);%0A    assertEquals(1, rule.match(langTool.getAnalyzedSentence(%22Dort, die riesigen Tischs!%22)).length);%0A    assertEquals(1, rule.match(langTool.getAnalyzedSentence(%22Als die riesigen Tischs kamen.%22)).length);%0A    assertEquals(1, rule.match(langTool.getAnalyzedSentence(%22Als die riesigen Tisches kamen.%22)).length);%0A//FIXME?:%0A    //assertEquals(1, rule.match(langTool.getAnalyzedSentence(%22Der riesigen Tisch und so.%22)).length);%0A  %7D%0A  %0A%7D%0A

test for German agreement checker