Revision: 8326
          
http://languagetool.svn.sourceforge.net/languagetool/?rev=8326&view=rev
Author:   dnaber
Date:     2012-11-09 17:34:10 +0000 (Fri, 09 Nov 2012)
Log Message:
-----------
[nl] add a compound rule for Dutch

Modified Paths:
--------------
    trunk/JLanguageTool/src/main/java/org/languagetool/language/Dutch.java
    
trunk/JLanguageTool/src/main/java/org/languagetool/rules/en/CompoundRule.java

Added Paths:
-----------
    
trunk/JLanguageTool/src/main/java/org/languagetool/rules/nl/CompoundRule.java
    
trunk/JLanguageTool/src/main/resources/org/languagetool/resource/nl/compounds.txt

Modified: trunk/JLanguageTool/src/main/java/org/languagetool/language/Dutch.java
===================================================================
--- trunk/JLanguageTool/src/main/java/org/languagetool/language/Dutch.java      
2012-11-09 17:27:12 UTC (rev 8325)
+++ trunk/JLanguageTool/src/main/java/org/languagetool/language/Dutch.java      
2012-11-09 17:34:10 UTC (rev 8326)
@@ -29,6 +29,7 @@
 import org.languagetool.rules.Rule;
 import org.languagetool.rules.UppercaseSentenceStartRule;
 import org.languagetool.rules.WhitespaceRule;
+import org.languagetool.rules.nl.CompoundRule;
 import org.languagetool.rules.nl.MorfologikDutchSpellerRule;
 import org.languagetool.synthesis.Synthesizer;
 import org.languagetool.synthesis.nl.DutchSynthesizer;
@@ -134,7 +135,8 @@
             GenericUnpairedBracketsRule.class,
             UppercaseSentenceStartRule.class,
             MorfologikDutchSpellerRule.class,
-            WhitespaceRule.class
+            WhitespaceRule.class,
+            CompoundRule.class
     );
   }
 

Modified: 
trunk/JLanguageTool/src/main/java/org/languagetool/rules/en/CompoundRule.java
===================================================================
--- 
trunk/JLanguageTool/src/main/java/org/languagetool/rules/en/CompoundRule.java   
    2012-11-09 17:27:12 UTC (rev 8325)
+++ 
trunk/JLanguageTool/src/main/java/org/languagetool/rules/en/CompoundRule.java   
    2012-11-09 17:34:10 UTC (rev 8326)
@@ -25,10 +25,7 @@
 
 /**
  * Checks that compounds (if in the list) are not written as separate words.
- * 
- * @author Marcin MiƂkowski, based on code by Daniel Naber
  */
-
 public class CompoundRule extends AbstractCompoundRule {
 
   private static final String FILE_NAME = "/en/compounds.txt";
@@ -51,5 +48,4 @@
     return "Hyphenated words, e.g., 'case-sensitive' instead of 'case 
sensitive'";
   }    
 
-  
 }

Added: 
trunk/JLanguageTool/src/main/java/org/languagetool/rules/nl/CompoundRule.java
===================================================================
--- 
trunk/JLanguageTool/src/main/java/org/languagetool/rules/nl/CompoundRule.java   
                            (rev 0)
+++ 
trunk/JLanguageTool/src/main/java/org/languagetool/rules/nl/CompoundRule.java   
    2012-11-09 17:34:10 UTC (rev 8326)
@@ -0,0 +1,51 @@
+/* LanguageTool, a natural language style checker
+ * Copyright (C) 2006 Daniel Naber (http://www.danielnaber.de)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
+ * USA
+ */
+package org.languagetool.rules.nl;
+
+import org.languagetool.rules.AbstractCompoundRule;
+
+import java.io.IOException;
+import java.util.ResourceBundle;
+
+/**
+ * Checks that compounds (if in the list) are not written as separate words.
+ */
+public class CompoundRule extends AbstractCompoundRule {
+
+  private static final String FILE_NAME = "/nl/compounds.txt";
+
+  public CompoundRule(final ResourceBundle messages) throws IOException {
+    super(messages, FILE_NAME,
+            "This word is normally spelled with hyphen.",
+            "This word is normally spelled as one.",
+            "This expression is normally spelled as one or with hyphen.");
+    super.setShort("Hyphenation problem");
+  }
+
+  @Override
+  public String getId() {
+    return "NL_COMPOUNDS";
+  }
+
+  @Override
+  public String getDescription() {
+    return "Hyphenated words, e.g., 'case-sensitive' instead of 'case 
sensitive'";
+  }
+
+}

Added: 
trunk/JLanguageTool/src/main/resources/org/languagetool/resource/nl/compounds.txt
===================================================================
--- 
trunk/JLanguageTool/src/main/resources/org/languagetool/resource/nl/compounds.txt
                           (rev 0)
+++ 
trunk/JLanguageTool/src/main/resources/org/languagetool/resource/nl/compounds.txt
   2012-11-09 17:34:10 UTC (rev 8326)
@@ -0,0 +1,7 @@
+# Compound words that are usually not written as
+# separate words.
+# Encoding: UTF-8
+# All words must contain at least one hyphen, even if the
+# word is usually not spelled with a hyphen
+# "+" at the end of the line will turn off the suggestion that
+# uses a hyphen

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


------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_nov
_______________________________________________
Languagetool-commits mailing list
Languagetool-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/languagetool-commits

Reply via email to