Skip to content

Instantly share code, notes, and snippets.

@danielnaber
Created September 30, 2020 16:08
Show Gist options
  • Save danielnaber/ed4d423deaf21338f97ff547e7dabbee to your computer and use it in GitHub Desktop.
Save danielnaber/ed4d423deaf21338f97ff547e7dabbee to your computer and use it in GitHub Desktop.
diff --git a/languagetool-language-modules/nl/src/main/java/org/languagetool/language/BelgianDutch.java b/languagetool-language-modules/nl/src/main/java/org/languagetool/language/BelgianDutch.java
new file mode 100644
index 0000000000..edabaaf58a
--- /dev/null
+++ b/languagetool-language-modules/nl/src/main/java/org/languagetool/language/BelgianDutch.java
@@ -0,0 +1,33 @@
+/* LanguageTool, a natural language style checker
+ * Copyright (C) 2007 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.language;
+
+public class BelgianDutch extends Dutch {
+
+ @Override
+ public String getName() {
+ return "Dutch (Belgium)";
+ }
+
+ @Override
+ public String[] getCountries() {
+ return new String[]{"BE"};
+ }
+
+}
diff --git a/languagetool-language-modules/nl/src/main/java/org/languagetool/language/Dutch.java b/languagetool-language-modules/nl/src/main/java/org/languagetool/language/Dutch.java
index 3e543fd24f..bf31adfbad 100644
--- a/languagetool-language-modules/nl/src/main/java/org/languagetool/language/Dutch.java
+++ b/languagetool-language-modules/nl/src/main/java/org/languagetool/language/Dutch.java
@@ -39,8 +39,15 @@ import java.util.*;
public class Dutch extends Language {
+ private static final Language NETHERLANDS_DUTCH = new NetherlandsDutch();
+
private LanguageModel languageModel;
+ @Override
+ public Language getDefaultLanguageVariant() {
+ return NETHERLANDS_DUTCH;
+ }
+
@Override
public String getName() {
return "Dutch";
diff --git a/languagetool-language-modules/nl/src/main/java/org/languagetool/language/NetherlandsDutch.java b/languagetool-language-modules/nl/src/main/java/org/languagetool/language/NetherlandsDutch.java
new file mode 100644
index 0000000000..da048384a6
--- /dev/null
+++ b/languagetool-language-modules/nl/src/main/java/org/languagetool/language/NetherlandsDutch.java
@@ -0,0 +1,33 @@
+/* LanguageTool, a natural language style checker
+ * Copyright (C) 2007 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.language;
+
+public class NetherlandsDutch extends Dutch {
+
+ @Override
+ public String getName() {
+ return "Dutch (Netherlands)";
+ }
+
+ @Override
+ public String[] getCountries() {
+ return new String[]{"NL"};
+ }
+
+}
diff --git a/languagetool-language-modules/nl/src/main/resources/META-INF/org/languagetool/language-module.properties b/languagetool-language-modules/nl/src/main/resources/META-INF/org/languagetool/language-module.properties
index 8a6dfa60d8..bf3cbf2da5 100644
--- a/languagetool-language-modules/nl/src/main/resources/META-INF/org/languagetool/language-module.properties
+++ b/languagetool-language-modules/nl/src/main/resources/META-INF/org/languagetool/language-module.properties
@@ -1 +1 @@
-languageClasses=org.languagetool.language.Dutch
+languageClasses=org.languagetool.language.Dutch,org.languagetool.language.NetherlandsDutch,org.languagetool.language.BelgianDutch
diff --git a/languagetool-language-modules/nl/src/main/resources/org/languagetool/rules/nl/nl-BE/grammar.xml b/languagetool-language-modules/nl/src/main/resources/org/languagetool/rules/nl/nl-BE/grammar.xml
index cf5eb5b952..0b1ad6bf12 100644
--- a/languagetool-language-modules/nl/src/main/resources/org/languagetool/rules/nl/nl-BE/grammar.xml
+++ b/languagetool-language-modules/nl/src/main/resources/org/languagetool/rules/nl/nl-BE/grammar.xml
@@ -55,10 +55,10 @@ This is also useful for most multi word rules, because of 'inversion' of the sen
<!ENTITY vaag_mess "Pas op met vage taal. Probeer preciezer te zijn.">
<!ENTITY vlotter_mess "De tekst wordt vlotter wanneer u deze herschrijft met">
]>
-<rules xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" lang="nl" xsi:noNamespaceSchemaLocation="../../../../../../../../../languagetool-core/src/main/resources/org/languagetool/rules/rules.xsd">
+<rules xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" lang="nl-BE" xsi:noNamespaceSchemaLocation="../../../../../../../../../../languagetool-core/src/main/resources/org/languagetool/rules/rules.xsd">
<category id="BE_NL" name="Verschil België en Nederland" type="style">
- <rulegroup id="ALLEEN_BE" name="Alleen gebruikelijk in België">
+ <rulegroup id="ALLEEN_BE_" name="Alleen gebruikelijk in België">
<rule>
<pattern>
<token>mazout</token>
diff --git a/languagetool-language-modules/nl/src/main/resources/org/languagetool/rules/nl/nl-NL/grammar.xml b/languagetool-language-modules/nl/src/main/resources/org/languagetool/rules/nl/nl-NL/grammar.xml
index 8abc9e4d65..de08d56a2f 100644
--- a/languagetool-language-modules/nl/src/main/resources/org/languagetool/rules/nl/nl-NL/grammar.xml
+++ b/languagetool-language-modules/nl/src/main/resources/org/languagetool/rules/nl/nl-NL/grammar.xml
@@ -55,10 +55,10 @@ This is also useful for most multi word rules, because of 'inversion' of the sen
<!ENTITY vaag_mess "Pas op met vage taal. Probeer preciezer te zijn.">
<!ENTITY vlotter_mess "De tekst wordt vlotter wanneer u deze herschrijft met">
]>
-<rules xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" lang="nl" xsi:noNamespaceSchemaLocation="../../../../../../../../../languagetool-core/src/main/resources/org/languagetool/rules/rules.xsd">
+<rules xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" lang="nl-NL" xsi:noNamespaceSchemaLocation="../../../../../../../../../../languagetool-core/src/main/resources/org/languagetool/rules/rules.xsd">
<category id="BE_NL" name="Verschil België en Nederland" type="style">
- <rulegroup id="ALLEEN_NL" name="Alleen bekend in Nederland">
+ <rulegroup id="ALLEEN_NL_" name="Alleen bekend in Nederland">
<rule>
<pattern>
<token>willens</token>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment