Revision: 7499
          
http://languagetool.svn.sourceforge.net/languagetool/?rev=7499&view=rev
Author:   milek_pl
Date:     2012-06-25 08:24:01 +0000 (Mon, 25 Jun 2012)
Log Message:
-----------
add contractions to dictionaries, add proper JUnit tests, fix other 
tokenization issues

Modified Paths:
--------------
    trunk/JLanguageTool/src/resource/en/hunspell/en_AU.dict
    trunk/JLanguageTool/src/resource/en/hunspell/en_CA.dict
    trunk/JLanguageTool/src/resource/en/hunspell/en_GB.dict
    trunk/JLanguageTool/src/resource/en/hunspell/en_NZ.dict
    trunk/JLanguageTool/src/resource/en/hunspell/en_US.dict
    trunk/JLanguageTool/src/resource/en/hunspell/en_ZA.dict
    
trunk/JLanguageTool/src/test/org/languagetool/rules/en/MorfologikAmericanSpellerRuleTest.java
    
trunk/JLanguageTool/src/test/org/languagetool/rules/en/MorfologikBritishSpellerRuleTest.java
    
trunk/JLanguageTool/src/test/org/languagetool/rules/en/MorfologikCanadianSpellerRuleTest.java

Added Paths:
-----------
    
trunk/JLanguageTool/src/test/org/languagetool/rules/en/MorfologikAustralianSpellerRuleTest.java
    
trunk/JLanguageTool/src/test/org/languagetool/rules/en/MorfologikNewZealandSpellerRuleTest.java
    
trunk/JLanguageTool/src/test/org/languagetool/rules/en/MorfologikSouthAfricanSpellerRuleTest.java

Modified: trunk/JLanguageTool/src/resource/en/hunspell/en_AU.dict
===================================================================
(Binary files differ)

Modified: trunk/JLanguageTool/src/resource/en/hunspell/en_CA.dict
===================================================================
(Binary files differ)

Modified: trunk/JLanguageTool/src/resource/en/hunspell/en_GB.dict
===================================================================
(Binary files differ)

Modified: trunk/JLanguageTool/src/resource/en/hunspell/en_NZ.dict
===================================================================
(Binary files differ)

Modified: trunk/JLanguageTool/src/resource/en/hunspell/en_US.dict
===================================================================
(Binary files differ)

Modified: trunk/JLanguageTool/src/resource/en/hunspell/en_ZA.dict
===================================================================
(Binary files differ)

Modified: 
trunk/JLanguageTool/src/test/org/languagetool/rules/en/MorfologikAmericanSpellerRuleTest.java
===================================================================
--- 
trunk/JLanguageTool/src/test/org/languagetool/rules/en/MorfologikAmericanSpellerRuleTest.java
       2012-06-25 08:15:19 UTC (rev 7498)
+++ 
trunk/JLanguageTool/src/test/org/languagetool/rules/en/MorfologikAmericanSpellerRuleTest.java
       2012-06-25 08:24:01 UTC (rev 7499)
@@ -24,6 +24,8 @@
         // correct sentences:
         assertEquals(0, rule.match(langTool.getAnalyzedSentence("This is an 
example: we get behavior as a dictionary word.")).length);
         assertEquals(0, rule.match(langTool.getAnalyzedSentence("Why don't we 
speak today.")).length);
+        //with doesn't
+        assertEquals(0, rule.match(langTool.getAnalyzedSentence("He doesn't 
know what to do.")).length);
         assertEquals(0, rule.match(langTool.getAnalyzedSentence(",")).length);
         assertEquals(0, 
rule.match(langTool.getAnalyzedSentence("123454")).length);
 

Added: 
trunk/JLanguageTool/src/test/org/languagetool/rules/en/MorfologikAustralianSpellerRuleTest.java
===================================================================
--- 
trunk/JLanguageTool/src/test/org/languagetool/rules/en/MorfologikAustralianSpellerRuleTest.java
                             (rev 0)
+++ 
trunk/JLanguageTool/src/test/org/languagetool/rules/en/MorfologikAustralianSpellerRuleTest.java
     2012-06-25 08:24:01 UTC (rev 7499)
@@ -0,0 +1,49 @@
+package org.languagetool.rules.en;
+
+import static org.junit.Assert.*;
+
+import java.io.IOException;
+
+import org.junit.Test;
+import org.languagetool.JLanguageTool;
+import org.languagetool.Language;
+import org.languagetool.TestTools;
+import org.languagetool.rules.RuleMatch;
+
+public class MorfologikAustralianSpellerRuleTest {
+
+    @Test
+    public void testMorfologikSpeller() throws IOException {
+        MorfologikAustralianSpellerRule rule =
+                new MorfologikAustralianSpellerRule 
(TestTools.getMessages("English"), Language.AUSTRALIAN_ENGLISH);
+
+        RuleMatch[] matches;
+        JLanguageTool langTool = new 
JLanguageTool(Language.AUSTRALIAN_ENGLISH);
+
+
+        // correct sentences:
+        assertEquals(0, rule.match(langTool.getAnalyzedSentence("This is an 
example: we get behaviour as a dictionary word.")).length);
+        assertEquals(0, rule.match(langTool.getAnalyzedSentence("Why don't we 
speak today.")).length);
+        //with doesn't
+        assertEquals(0, rule.match(langTool.getAnalyzedSentence("He doesn't 
know what to do.")).length);
+        assertEquals(0, rule.match(langTool.getAnalyzedSentence(",")).length);
+        assertEquals(0, 
rule.match(langTool.getAnalyzedSentence("123454")).length);
+
+        //Australian dict:
+        assertEquals(0, 
rule.match(langTool.getAnalyzedSentence("Agnathia")).length);        
+        
+        //incorrect sentences:
+
+        matches = rule.match(langTool.getAnalyzedSentence("behavior"));
+        // check match positions:
+        assertEquals(1, matches.length);
+        assertEquals(0, matches[0].getFromPos());
+        assertEquals(8, matches[0].getToPos());
+        assertEquals("behaviour", 
matches[0].getSuggestedReplacements().get(0));
+
+        assertEquals(1, 
rule.match(langTool.getAnalyzedSentence("aõh")).length);
+        assertEquals(0, rule.match(langTool.getAnalyzedSentence("a")).length);
+
+    }
+
+}


Property changes on: 
trunk/JLanguageTool/src/test/org/languagetool/rules/en/MorfologikAustralianSpellerRuleTest.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Modified: 
trunk/JLanguageTool/src/test/org/languagetool/rules/en/MorfologikBritishSpellerRuleTest.java
===================================================================
--- 
trunk/JLanguageTool/src/test/org/languagetool/rules/en/MorfologikBritishSpellerRuleTest.java
        2012-06-25 08:15:19 UTC (rev 7498)
+++ 
trunk/JLanguageTool/src/test/org/languagetool/rules/en/MorfologikBritishSpellerRuleTest.java
        2012-06-25 08:24:01 UTC (rev 7499)
@@ -24,6 +24,8 @@
         // correct sentences:
         assertEquals(0, rule.match(langTool.getAnalyzedSentence("This is an 
example: we get behaviour as a dictionary word.")).length);
         assertEquals(0, rule.match(langTool.getAnalyzedSentence("Why don't we 
speak today.")).length);
+        //with doesn't
+        assertEquals(0, rule.match(langTool.getAnalyzedSentence("He doesn't 
know what to do.")).length);
         assertEquals(0, rule.match(langTool.getAnalyzedSentence(",")).length);
         assertEquals(0, 
rule.match(langTool.getAnalyzedSentence("123454")).length);
 

Modified: 
trunk/JLanguageTool/src/test/org/languagetool/rules/en/MorfologikCanadianSpellerRuleTest.java
===================================================================
--- 
trunk/JLanguageTool/src/test/org/languagetool/rules/en/MorfologikCanadianSpellerRuleTest.java
       2012-06-25 08:15:19 UTC (rev 7498)
+++ 
trunk/JLanguageTool/src/test/org/languagetool/rules/en/MorfologikCanadianSpellerRuleTest.java
       2012-06-25 08:24:01 UTC (rev 7499)
@@ -24,6 +24,8 @@
         // correct sentences:
         assertEquals(0, rule.match(langTool.getAnalyzedSentence("This is an 
example: we get behaviour as a dictionary word.")).length);
         assertEquals(0, rule.match(langTool.getAnalyzedSentence("Why don't we 
speak today.")).length);
+        //with doesn't
+        assertEquals(0, rule.match(langTool.getAnalyzedSentence("He doesn't 
know what to do.")).length);
         assertEquals(0, rule.match(langTool.getAnalyzedSentence(",")).length);
         assertEquals(0, 
rule.match(langTool.getAnalyzedSentence("123454")).length);
 

Added: 
trunk/JLanguageTool/src/test/org/languagetool/rules/en/MorfologikNewZealandSpellerRuleTest.java
===================================================================
--- 
trunk/JLanguageTool/src/test/org/languagetool/rules/en/MorfologikNewZealandSpellerRuleTest.java
                             (rev 0)
+++ 
trunk/JLanguageTool/src/test/org/languagetool/rules/en/MorfologikNewZealandSpellerRuleTest.java
     2012-06-25 08:24:01 UTC (rev 7499)
@@ -0,0 +1,49 @@
+package org.languagetool.rules.en;
+
+import static org.junit.Assert.*;
+
+import java.io.IOException;
+
+import org.junit.Test;
+import org.languagetool.JLanguageTool;
+import org.languagetool.Language;
+import org.languagetool.TestTools;
+import org.languagetool.rules.RuleMatch;
+
+public class MorfologikNewZealandSpellerRuleTest {
+
+    @Test
+    public void testMorfologikSpeller() throws IOException {
+        MorfologikNewZealandSpellerRule rule =
+                new MorfologikNewZealandSpellerRule 
(TestTools.getMessages("English"), Language.NEW_ZEALAND_ENGLISH);
+
+        RuleMatch[] matches;
+        JLanguageTool langTool = new 
JLanguageTool(Language.NEW_ZEALAND_ENGLISH);
+
+
+        // correct sentences:
+        assertEquals(0, rule.match(langTool.getAnalyzedSentence("This is an 
example: we get behaviour as a dictionary word.")).length);
+        assertEquals(0, rule.match(langTool.getAnalyzedSentence("Why don't we 
speak today.")).length);
+        //with doesn't
+        assertEquals(0, rule.match(langTool.getAnalyzedSentence("He doesn't 
know what to do.")).length);
+        assertEquals(0, rule.match(langTool.getAnalyzedSentence(",")).length);
+        assertEquals(0, 
rule.match(langTool.getAnalyzedSentence("123454")).length);
+
+        //special New Zealand content:
+        assertEquals(0, 
rule.match(langTool.getAnalyzedSentence("Abercrombie")).length);        
+        
+        //incorrect sentences:
+
+        matches = rule.match(langTool.getAnalyzedSentence("behavior"));
+        // check match positions:
+        assertEquals(1, matches.length);
+        assertEquals(0, matches[0].getFromPos());
+        assertEquals(8, matches[0].getToPos());
+        assertEquals("behaviour", 
matches[0].getSuggestedReplacements().get(0));
+
+        assertEquals(1, 
rule.match(langTool.getAnalyzedSentence("aõh")).length);
+        assertEquals(0, rule.match(langTool.getAnalyzedSentence("a")).length);
+
+    }
+
+}


Property changes on: 
trunk/JLanguageTool/src/test/org/languagetool/rules/en/MorfologikNewZealandSpellerRuleTest.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Added: 
trunk/JLanguageTool/src/test/org/languagetool/rules/en/MorfologikSouthAfricanSpellerRuleTest.java
===================================================================
--- 
trunk/JLanguageTool/src/test/org/languagetool/rules/en/MorfologikSouthAfricanSpellerRuleTest.java
                           (rev 0)
+++ 
trunk/JLanguageTool/src/test/org/languagetool/rules/en/MorfologikSouthAfricanSpellerRuleTest.java
   2012-06-25 08:24:01 UTC (rev 7499)
@@ -0,0 +1,49 @@
+package org.languagetool.rules.en;
+
+import static org.junit.Assert.*;
+
+import java.io.IOException;
+
+import org.junit.Test;
+import org.languagetool.JLanguageTool;
+import org.languagetool.Language;
+import org.languagetool.TestTools;
+import org.languagetool.rules.RuleMatch;
+
+public class MorfologikSouthAfricanSpellerRuleTest {
+
+    @Test
+    public void testMorfologikSpeller() throws IOException {
+        MorfologikSouthAfricanSpellerRule rule =
+                new MorfologikSouthAfricanSpellerRule 
(TestTools.getMessages("English"), Language.SOUTH_AFRICAN_ENGLISH);
+
+        RuleMatch[] matches;
+        JLanguageTool langTool = new 
JLanguageTool(Language.SOUTH_AFRICAN_ENGLISH);
+
+
+        // correct sentences:
+        assertEquals(0, rule.match(langTool.getAnalyzedSentence("This is an 
example: we get behaviour as a dictionary word.")).length);
+        assertEquals(0, rule.match(langTool.getAnalyzedSentence("Why don't we 
speak today.")).length);
+        //with doesn't
+        assertEquals(0, rule.match(langTool.getAnalyzedSentence("He doesn't 
know what to do.")).length);
+        assertEquals(0, rule.match(langTool.getAnalyzedSentence(",")).length);
+        assertEquals(0, 
rule.match(langTool.getAnalyzedSentence("123454")).length);
+
+        //South African dict:
+        assertEquals(0, 
rule.match(langTool.getAnalyzedSentence("Amanzimnyama")).length);        
+        
+        //incorrect sentences:
+
+        matches = rule.match(langTool.getAnalyzedSentence("behavior"));
+        // check match positions:
+        assertEquals(1, matches.length);
+        assertEquals(0, matches[0].getFromPos());
+        assertEquals(8, matches[0].getToPos());
+        assertEquals("behaviour", 
matches[0].getSuggestedReplacements().get(0));
+
+        assertEquals(1, 
rule.match(langTool.getAnalyzedSentence("aõh")).length);
+        assertEquals(0, rule.match(langTool.getAnalyzedSentence("a")).length);
+
+    }
+
+}


Property changes on: 
trunk/JLanguageTool/src/test/org/languagetool/rules/en/MorfologikSouthAfricanSpellerRuleTest.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

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