Revision: 7505
          
http://languagetool.svn.sourceforge.net/languagetool/?rev=7505&view=rev
Author:   dominikoeo
Date:     2012-06-25 18:54:14 +0000 (Mon, 25 Jun 2012)
Log Message:
-----------
- added unit tests for French and Breton Hunspell rules,
  especially for things that were modified in Hunspell
  *.aff or *.dic so that we don't forget to modify it
  next time we re-download them.

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-25 18:45:20 UTC (rev 7504)
+++ trunk/JLanguageTool/src/test/org/languagetool/rules/HunspellRuleTest.java   
2012-06-25 18:54:14 UTC (rev 7505)
@@ -74,6 +74,42 @@
     assertEquals(2, rule.match(langTool.getAnalyzedSentence("Der asdegfue 
orkt")).length);
   }
 
+  @Test
+  public void testRuleWithFrench() throws Exception {
+    final HunspellRule rule = new 
HunspellRule(TestTools.getMessages("French"), Language.FRENCH);
+    final JLanguageTool langTool = new JLanguageTool(Language.FRENCH);
+
+    assertEquals(0, rule.match(langTool.getAnalyzedSentence("Un test 
simple.")).length);
+    assertEquals(1, rule.match(langTool.getAnalyzedSentence("Un test 
simpple.")).length);
+    assertEquals(0, rule.match(langTool.getAnalyzedSentence("Le cœur, la 
sœur.")).length);
+
+    assertEquals(0, 
rule.match(langTool.getAnalyzedSentence("LanguageTool")).length);
+
+    // Tests with dash and apostrophes.
+    assertEquals(0, rule.match(langTool.getAnalyzedSentence("Il arrive 
après-demain.")).length);
+    assertEquals(0, 
rule.match(langTool.getAnalyzedSentence("L'Haÿ-les-Roses")).length);
+    assertEquals(1, rule.match(langTool.getAnalyzedSentence("L'Haÿ les 
Roses")).length);
+
+    assertEquals(0, rule.match(langTool.getAnalyzedSentence("Aujourd'hui et 
jusqu'à demain.")).length);
+    assertEquals(0, rule.match(langTool.getAnalyzedSentence("Aujourd’hui et 
jusqu’à demain.")).length);
+    assertEquals(0, rule.match(langTool.getAnalyzedSentence("L'Allemagne et 
l'Italie.")).length);
+    assertEquals(0, rule.match(langTool.getAnalyzedSentence("L’Allemagne et 
l’Italie.")).length);
+    assertEquals(2, rule.match(langTool.getAnalyzedSentence("L’allemagne et 
l’italie.")).length);
+  }
+
+  @Test
+  public void testRuleWithBreton() throws Exception {
+    final HunspellRule rule = new 
HunspellRule(TestTools.getMessages("Breton"), Language.BRETON);
+    final JLanguageTool langTool = new JLanguageTool(Language.BRETON);
+
+    assertEquals(0, rule.match(langTool.getAnalyzedSentence("Penaos emañ kont 
ganit?")).length);
+    assertEquals(0, rule.match(langTool.getAnalyzedSentence("C'hwerc'h merc'h 
gwerc'h war c'hwerc'h marc'h kalloc'h")).length);
+    assertEquals(0, rule.match(langTool.getAnalyzedSentence("C’hwerc’h merc’h 
gwerc‘h war c‘hwerc‘h marc'h kalloc‘h")).length);
+    assertEquals(0, 
rule.match(langTool.getAnalyzedSentence("Evel-just")).length);
+    assertEquals(1, 
rule.match(langTool.getAnalyzedSentence("Evel-juste")).length);
+    assertEquals(0, rule.match(langTool.getAnalyzedSentence("Barrek-tre eo 
LanguageTool")).length);
+  }
+
   @Ignore("just for internal performance testing, thus ignored by default")
   @Test
   public void testPerformance() throws Exception {

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