Revision: 7346
          
http://languagetool.svn.sourceforge.net/languagetool/?rev=7346&view=rev
Author:   dnaber
Date:     2012-06-14 22:33:59 +0000 (Thu, 14 Jun 2012)
Log Message:
-----------
[de] adding test for spell checker

Modified Paths:
--------------
    trunk/JLanguageTool/src/test/org/languagetool/rules/HunspellRuleTest.java

Modified: 
trunk/JLanguageTool/src/test/org/languagetool/rules/HunspellRuleTest.java
===================================================================
--- trunk/JLanguageTool/src/test/org/languagetool/rules/HunspellRuleTest.java   
2012-06-14 20:55:39 UTC (rev 7345)
+++ trunk/JLanguageTool/src/test/org/languagetool/rules/HunspellRuleTest.java   
2012-06-14 22:33:59 UTC (rev 7346)
@@ -80,4 +80,24 @@
     assertEquals("Pera", matches[0].getSuggestedReplacements().get(0));
   }
 
+  @Test
+  public void testRuleWithGerman() throws UnsatisfiedLinkError, 
UnsupportedOperationException, IOException {
+    final HunspellRule rule = new 
HunspellRule(TestTools.getMessages("German"), Language.GERMANY_GERMAN);
+    final JLanguageTool langTool = new JLanguageTool(Language.GERMAN);
+    assertEquals(0, rule.match(langTool.getAnalyzedSentence("Der 
Waschmaschinentestversuch")).length);  // compound
+    assertEquals(0, rule.match(langTool.getAnalyzedSentence("Der äußere 
Übeltäter.")).length);  // umlauts
+    assertEquals(1, rule.match(langTool.getAnalyzedSentence("Der äussere 
Übeltäter.")).length);
+    assertEquals(1, rule.match(langTool.getAnalyzedSentence("Der 
Waschmaschinentestversuch orkt")).length);
+  }
+
+  @Test
+  public void testRuleWithSwissGerman() throws UnsatisfiedLinkError, 
UnsupportedOperationException, IOException {
+    final HunspellRule rule = new 
HunspellRule(TestTools.getMessages("German"), Language.SWISS_GERMAN);
+    final JLanguageTool langTool = new JLanguageTool(Language.GERMAN);
+    assertEquals(0, rule.match(langTool.getAnalyzedSentence("Der 
Waschmaschinentestversuch")).length);  // compound
+    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 ß
+    assertEquals(1, rule.match(langTool.getAnalyzedSentence("Der 
Waschmaschinentestversuch orkt")).length);
+  }
+
 }

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Languagetool-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/languagetool-cvs

Reply via email to