From cb1fb760ad7715e918e07fa8bc041a169cd4d7f5 Mon Sep 17 00:00:00 2001 From: Hiroshi Miura Date: Wed, 4 Oct 2023 21:48:38 +0900 Subject: [PATCH] feat: add java8compat module Signed-off-by: Hiroshi Miura --- .../main/java/org/languagetool/Languages.java | 4 + .../language-java8compat/pom.xml | 296 ++++++++++++ .../language/AbstractLanguageProxy.java | 438 ++++++++++++++++++ .../language/AmericanEnglish.java | 25 + .../language/AngolaPortuguese.java | 25 + .../org/languagetool/language/Arabic.java | 25 + .../org/languagetool/language/Asturian.java | 26 ++ .../language/AustralianEnglish.java | 25 + .../languagetool/language/AustrianGerman.java | 25 + .../language/BalearicCatalan.java | 25 + .../languagetool/language/BelgianDutch.java | 25 + .../languagetool/language/BelgianFrench.java | 25 + .../language/BrazilianPortuguese.java | 25 + .../org/languagetool/language/Breton.java | 25 + .../languagetool/language/BritishEnglish.java | 25 + .../language/CanadianEnglish.java | 25 + .../languagetool/language/CanadianFrench.java | 25 + .../org/languagetool/language/Catalan.java | 25 + .../org/languagetool/language/Chinese.java | 25 + .../org/languagetool/language/Danish.java | 26 ++ .../java/org/languagetool/language/Dutch.java | 25 + .../org/languagetool/language/English.java | 25 + .../org/languagetool/language/Esperanto.java | 25 + .../org/languagetool/language/French.java | 25 + .../org/languagetool/language/Galician.java | 25 + .../languagetool/language/GermanyGerman.java | 25 + .../java/org/languagetool/language/Greek.java | 25 + .../org/languagetool/language/Icelandic.java | 26 ++ .../java/org/languagetool/language/Irish.java | 25 + .../org/languagetool/language/Italian.java | 25 + .../org/languagetool/language/Japanese.java | 25 + .../java/org/languagetool/language/Khmer.java | 25 + .../org/languagetool/language/Lithuanian.java | 26 ++ .../org/languagetool/language/Malayalam.java | 26 ++ .../language/MozambiquePortuguese.java | 25 + .../language/NewZealandEnglish.java | 25 + .../languagetool/language/NonSwissGerman.java | 25 + .../org/languagetool/language/Persian.java | 25 + .../org/languagetool/language/Polish.java | 25 + .../language/PortugalPortuguese.java | 25 + .../org/languagetool/language/Portuguese.java | 25 + .../org/languagetool/language/Romanian.java | 25 + .../org/languagetool/language/Russian.java | 25 + .../languagetool/language/SimpleGerman.java | 25 + .../org/languagetool/language/Slovak.java | 25 + .../org/languagetool/language/Slovenian.java | 26 ++ .../language/SouthAfricanEnglish.java | 25 + .../org/languagetool/language/Spanish.java | 25 + .../languagetool/language/SpanishVoseo.java | 25 + .../org/languagetool/language/Swedish.java | 26 ++ .../languagetool/language/SwissFrench.java | 25 + .../languagetool/language/SwissGerman.java | 25 + .../org/languagetool/language/Tagalog.java | 26 ++ .../java/org/languagetool/language/Tamil.java | 25 + .../org/languagetool/language/Ukrainian.java | 25 + .../languagetool/language/Ukrainian1992.java | 25 + .../language/ValencianCatalan.java | 25 + .../org/languagetool/language/BretonTest.java | 39 ++ .../languagetool/language/CatalanTest.java | 111 +++++ .../languagetool/language/ChineseTest.java | 39 ++ .../org/languagetool/language/DanishTest.java | 39 ++ .../org/languagetool/language/DutchTest.java | 54 +++ .../languagetool/language/EnglishTest.java | 336 ++++++++++++++ .../languagetool/language/EsperantoTest.java | 46 ++ .../org/languagetool/language/FrenchTest.java | 75 +++ .../languagetool/language/GalicianTest.java | 39 ++ .../org/languagetool/language/GermanTest.java | 75 +++ .../org/languagetool/language/GreekTest.java | 39 ++ .../languagetool/language/IcelandicTest.java | 35 ++ .../org/languagetool/language/IrishTest.java | 43 ++ .../languagetool/language/ItalianTest.java | 40 ++ .../languagetool/language/JapaneselTest.java | 37 ++ .../org/languagetool/language/KhmerTest.java | 39 ++ .../languagetool/language/LithuanianTest.java | 35 ++ .../languagetool/language/MalayalamTest.java | 35 ++ .../languagetool/language/PersianTest.java | 39 ++ .../org/languagetool/language/PolishTest.java | 39 ++ .../languagetool/language/PortugueseTest.java | 52 +++ .../languagetool/language/RomanianTest.java | 32 ++ .../languagetool/language/RussianTest.java | 39 ++ .../language/SimpleGermanTest.java | 40 ++ .../org/languagetool/language/SlovakTest.java | 35 ++ .../languagetool/language/SlovenianTest.java | 39 ++ .../languagetool/language/SpanishTest.java | 51 ++ .../languagetool/language/SwedishTest.java | 33 ++ .../languagetool/language/TagalogTest.java | 39 ++ .../org/languagetool/language/TamilTest.java | 39 ++ .../languagetool/language/UkrainianTest.java | 43 ++ pom.xml | 1 + 89 files changed, 3773 insertions(+) create mode 100644 languagetool-language-modules/language-java8compat/pom.xml create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/AbstractLanguageProxy.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/AmericanEnglish.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/AngolaPortuguese.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Arabic.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Asturian.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/AustralianEnglish.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/AustrianGerman.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/BalearicCatalan.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/BelgianDutch.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/BelgianFrench.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/BrazilianPortuguese.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Breton.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/BritishEnglish.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/CanadianEnglish.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/CanadianFrench.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Catalan.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Chinese.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Danish.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Dutch.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/English.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Esperanto.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/French.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Galician.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/GermanyGerman.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Greek.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Icelandic.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Irish.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Italian.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Japanese.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Khmer.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Lithuanian.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Malayalam.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/MozambiquePortuguese.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/NewZealandEnglish.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/NonSwissGerman.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Persian.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Polish.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/PortugalPortuguese.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Portuguese.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Romanian.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Russian.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/SimpleGerman.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Slovak.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Slovenian.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/SouthAfricanEnglish.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Spanish.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/SpanishVoseo.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Swedish.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/SwissFrench.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/SwissGerman.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Tagalog.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Tamil.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Ukrainian.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Ukrainian1992.java create mode 100644 languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/ValencianCatalan.java create mode 100644 languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/BretonTest.java create mode 100644 languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/CatalanTest.java create mode 100644 languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/ChineseTest.java create mode 100644 languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/DanishTest.java create mode 100644 languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/DutchTest.java create mode 100644 languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/EnglishTest.java create mode 100644 languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/EsperantoTest.java create mode 100644 languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/FrenchTest.java create mode 100644 languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/GalicianTest.java create mode 100644 languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/GermanTest.java create mode 100644 languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/GreekTest.java create mode 100644 languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/IcelandicTest.java create mode 100644 languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/IrishTest.java create mode 100644 languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/ItalianTest.java create mode 100644 languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/JapaneselTest.java create mode 100644 languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/KhmerTest.java create mode 100644 languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/LithuanianTest.java create mode 100644 languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/MalayalamTest.java create mode 100644 languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/PersianTest.java create mode 100644 languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/PolishTest.java create mode 100644 languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/PortugueseTest.java create mode 100644 languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/RomanianTest.java create mode 100644 languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/RussianTest.java create mode 100644 languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/SimpleGermanTest.java create mode 100644 languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/SlovakTest.java create mode 100644 languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/SlovenianTest.java create mode 100644 languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/SpanishTest.java create mode 100644 languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/SwedishTest.java create mode 100644 languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/TagalogTest.java create mode 100644 languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/TamilTest.java create mode 100644 languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/UkrainianTest.java diff --git a/languagetool-core/src/main/java/org/languagetool/Languages.java b/languagetool-core/src/main/java/org/languagetool/Languages.java index 61df84a9a44e..0dfd3dc5df52 100644 --- a/languagetool-core/src/main/java/org/languagetool/Languages.java +++ b/languagetool-core/src/main/java/org/languagetool/Languages.java @@ -153,9 +153,13 @@ private static Language createLanguageObjects(URL url, String className) { static boolean hasPremium(String className) { return className.matches("org\\.languagetool\\.language\\.(" + "pt\\.Portuguese|pt\\.AngolaPortuguese|pt\\.BrazilianPortuguese|pt\\.MozambiquePortuguese|pt\\.PortugalPortuguese|" + + "Portuguese|AngolaPortuguese|BrazilianPortuguese|MozambiquePortuguese|PortugalPortuguese|" + "de\\.German|de\\.GermanyGerman|de\\.AustrianGerman|de\\.SwissGerman|" + + "German|GermanyGerman|AustrianGerman|SwissGerman|" + "nl\\.Dutch|fr\\.French|es\\.Spanish|" + + "Dutch|French|Spanish|" + "en\\.English|en\\.AustralianEnglish|en\\.AmericanEnglish|en\\.BritishEnglish|en\\.CanadianEnglish|en\\.NewZealandEnglish|en\\.SouthAfricanEnglish" + + "English|AustralianEnglish|AmericanEnglish|BritishEnglish|CanadianEnglish|NewZealandEnglish|SouthAfricanEnglish" + ")"); } diff --git a/languagetool-language-modules/language-java8compat/pom.xml b/languagetool-language-modules/language-java8compat/pom.xml new file mode 100644 index 000000000000..fb2beb4840e5 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/pom.xml @@ -0,0 +1,296 @@ + + 4.0.0 + + + org.languagetool + languagetool-parent + ${revision} + ../../pom.xml + + + language-java8compat + https://www.languagetool.org + Java8 compatibility module for LanguageTool(no JPMS) + + + + + + GNU Lesser General Public License + http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt + repo + The license refers to the source code, resources may be under different licenses + + + + jar + + + + Hiroshi Miura + + Maintainer + + + + + + + + src/main/resources + + + + + maven-compiler-plugin + + + maven-surefire-plugin + + + + + + + org.languagetool + languagetool-core + ${revision} + + + + + org.languagetool + languagetool-core + ${revision} + test-jar + test + + + + + org.languagetool + language-ar + ${revision} + test + + + org.languagetool + language-be + ${revision} + test + + + org.languagetool + language-br + ${revision} + test + + + org.languagetool + language-ca + ${revision} + test + + + org.languagetool + language-da + ${revision} + test + + + org.languagetool + language-de + ${revision} + test + + + org.languagetool + language-de-DE-x-simple-language + ${revision} + test + + + org.languagetool + language-el + ${revision} + test + + + org.languagetool + language-en + ${revision} + test + + + org.languagetool + language-es + ${revision} + test + + + org.languagetool + language-eo + ${revision} + test + + + org.languagetool + language-fa + ${revision} + test + + + org.languagetool + language-fr + ${revision} + test + + + org.languagetool + language-ga + ${revision} + test + + + org.languagetool + language-gl + ${revision} + test + + + org.languagetool + language-is + ${revision} + test + + + org.languagetool + language-it + ${revision} + test + + + org.languagetool + language-ja + ${revision} + test + + + org.languagetool + language-km + ${revision} + test + + + org.languagetool + language-lt + ${revision} + test + + + org.languagetool + language-ml + ${revision} + test + + + org.languagetool + language-nl + ${revision} + test + + + org.languagetool + language-pl + ${revision} + test + + + org.languagetool + language-pt + ${revision} + test + + + org.languagetool + language-ro + ${revision} + test + + + org.languagetool + language-ru + ${revision} + test + + + org.languagetool + language-sk + ${revision} + test + + + org.languagetool + language-sl + ${revision} + test + + + org.languagetool + language-sv + ${revision} + test + + + org.languagetool + language-ta + ${revision} + test + + + org.languagetool + language-tl + ${revision} + test + + + org.languagetool + language-uk + ${revision} + test + + + org.languagetool + language-zh + ${revision} + test + + + junit + junit + ${junit.version} + test + + + ch.qos.logback + logback-classic + ${ch.qos.logback.version} + + + org.slf4j + slf4j-api + + + test + + + + + diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/AbstractLanguageProxy.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/AbstractLanguageProxy.java new file mode 100644 index 000000000000..c4913e229fcf --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/AbstractLanguageProxy.java @@ -0,0 +1,438 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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; + +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.languagetool.*; +import org.languagetool.chunking.Chunker; +import org.languagetool.language.Contributor; +import org.languagetool.languagemodel.LanguageModel; +import org.languagetool.markup.AnnotatedText; +import org.languagetool.rules.RemoteRuleConfig; +import org.languagetool.rules.Rule; +import org.languagetool.rules.RuleMatch; +import org.languagetool.rules.patterns.AbstractPatternRule; +import org.languagetool.rules.patterns.Unifier; +import org.languagetool.rules.patterns.UnifierConfiguration; +import org.languagetool.rules.spelling.SpellingCheckRule; +import org.languagetool.synthesis.Synthesizer; +import org.languagetool.tagging.Tagger; +import org.languagetool.tagging.disambiguation.Disambiguator; +import org.languagetool.tokenizers.SentenceTokenizer; +import org.languagetool.tokenizers.Tokenizer; + +import java.io.File; +import java.io.IOException; +import java.lang.reflect.InvocationTargetException; +import java.util.*; +import java.util.function.Function; +import java.util.regex.Pattern; + +/** + * @author Hiroshi Miura + */ +public abstract class AbstractLanguageProxy extends Language implements AutoCloseable { + private final Language impl; + + /** + * Abstract base class for backward comaptible + * org.langaugetool.langauge.(LANGUAGE) classes. + * It depends on classes `org.languagetool.language.(ln).(LANGUAGE) + * class extends org.languagetool.compat.LanguageCompat class. + * @param className Language full qualified class name. + */ + protected AbstractLanguageProxy(String className) { + try { + Class clazz = Class.forName(className); + impl = (Language) clazz.getDeclaredConstructor().newInstance(); + } catch (ClassNotFoundException | InvocationTargetException | InstantiationException | IllegalAccessException | + NoSuchMethodException e) { + throw new RuntimeException(e.getMessage()); + } + } + + public AbstractLanguageProxy() { + this(""); + } + + @Override + public String getShortCode() { + return impl.getShortCode(); + } + + @Override + public String getName() { + return impl.getName(); + } + + @Override + public String[] getCountries() { + return impl.getCountries(); + } + + @Nullable + @Override + public Contributor[] getMaintainers() { + return impl.getMaintainers(); + } + + @Override + public List getRelevantRules(ResourceBundle messages, UserConfig userConfig, Language motherTongue, List altLanguages) throws IOException { + return impl.getRelevantRules(messages, userConfig, motherTongue, altLanguages); + } + + @Override + public String getCommonWordsPath() { + return impl.getCommonWordsPath(); + } + + @Override + public String getVariant() { + return impl.getVariant(); + } + + @Override + public List getDefaultEnabledRulesForVariant() { + return impl.getDefaultEnabledRulesForVariant(); + } + + @Override + public List getDefaultDisabledRulesForVariant() { + return impl.getDefaultDisabledRulesForVariant(); + } + + @Override + public synchronized LanguageModel getLanguageModel(File indexDir) throws IOException { + return impl.getLanguageModel(indexDir); + } + + @Override + public List getRelevantLanguageModelRules(ResourceBundle messages, @Nullable LanguageModel languageModel, + UserConfig userConfig) throws IOException { + return impl.getRelevantLanguageModelRules(messages, languageModel, userConfig); + } + + @Override + public List getRelevantLanguageModelCapableRules(ResourceBundle messages, @Nullable LanguageModel lm, + GlobalConfig globalConfig, UserConfig userConfig, + Language motherTongue, List altLanguages) + throws IOException { + return impl.getRelevantLanguageModelCapableRules(messages, lm, globalConfig, userConfig, motherTongue, + altLanguages); + } + + @Override + public List getRelevantRemoteRules(ResourceBundle messageBundle, List configs, + GlobalConfig globalConfig, UserConfig userConfig, Language motherTongue, + List altLanguages, boolean inputLogging) throws IOException { + return impl.getRelevantRemoteRules(messageBundle, configs, globalConfig, userConfig, motherTongue, altLanguages, + inputLogging); + } + +/* + @Override + public Function getRemoteEnhancedRules( + ResourceBundle messageBundle, List configs, UserConfig userConfig, + Language motherTongue, List altLanguages, boolean inputLogging) throws IOException { + return impl.getRemoteEnhancedRules(messageBundle, configs, userConfig,motherTongue, altLanguages, inputLogging); + } +*/ + + @Override + public List getRelevantRulesGlobalConfig(ResourceBundle messages, GlobalConfig globalConfig, UserConfig userConfig, Language motherTongue, List altLanguages) throws IOException { + return impl.getRelevantRulesGlobalConfig(messages, globalConfig, userConfig, motherTongue, altLanguages); + } + + @Nullable + @Override + public SpellingCheckRule getDefaultSpellingRule() { + return impl.getDefaultSpellingRule(); + } + + @Override + public Locale getLocale() { + return impl.getLocale(); + } + + @Override + public Locale getLocaleWithCountryAndVariant() { + return impl.getLocaleWithCountryAndVariant(); + } + + @Override + public List getRuleFileNames() { + return impl.getRuleFileNames(); + } + + @NotNull + @Override + public Language getDefaultLanguageVariant() { + return impl.getDefaultLanguageVariant(); + } + + @Override + public Disambiguator createDefaultDisambiguator() { + return impl.createDefaultDisambiguator(); + } + + @Override + public void setDisambiguator(Disambiguator disambiguator) { + impl.setDisambiguator(disambiguator); + } + + @NotNull + @Override + public Tagger createDefaultTagger() { + return impl.createDefaultTagger(); + } + + @NotNull + @Override + public synchronized Tagger getTagger() { + return impl.getTagger(); + } + + @Override + public void setTagger(Tagger tagger) { + impl.setTagger(tagger); + } + + @Override + public SentenceTokenizer createDefaultSentenceTokenizer() { + return impl.createDefaultSentenceTokenizer(); + } + + @Override + public synchronized SentenceTokenizer getSentenceTokenizer() { + return impl.getSentenceTokenizer(); + } + + @Override + public void setSentenceTokenizer(SentenceTokenizer tokenizer) { + impl.setSentenceTokenizer(tokenizer); + } + + @Override + public Tokenizer createDefaultWordTokenizer() { + return impl.createDefaultWordTokenizer(); + } + + @Override + public synchronized Tokenizer getWordTokenizer() { + return impl.getWordTokenizer(); + } + + @Override + public void setWordTokenizer(Tokenizer tokenizer) { + impl.setWordTokenizer(tokenizer); + } + + @Nullable + @Override + public Chunker createDefaultChunker() { + return impl.createDefaultChunker(); + } + + @Override + public synchronized Chunker getChunker() { + return impl.getChunker(); + } + + @Override + public void setChunker(Chunker chunker) { + impl.setChunker(chunker); + } + + @Override + public Chunker createDefaultPostDisambiguationChunker() { + return impl.createDefaultPostDisambiguationChunker(); + } + + @Nullable + @Override + public synchronized Chunker getPostDisambiguationChunker() { + return impl.getPostDisambiguationChunker(); + } + + @Override + public void setPostDisambiguationChunker(Chunker chunker) { + impl.setPostDisambiguationChunker(chunker); + } + + @Override + public JLanguageTool createDefaultJLanguageTool() { + return impl.createDefaultJLanguageTool(); + } + + @Nullable + @Override + public Synthesizer createDefaultSynthesizer() { + return impl.createDefaultSynthesizer(); + } + + @Nullable + @Override + public synchronized Synthesizer getSynthesizer() { + return impl.getSynthesizer(); + } + + @Override + public void setSynthesizer(Synthesizer synthesizer) { + impl.setSynthesizer(synthesizer); + } + + @Override + public Unifier getUnifier() { + return impl.getUnifier(); + } + + @Override + public Unifier getDisambiguationUnifier() { + return impl.getDisambiguationUnifier(); + } + + @Override + public UnifierConfiguration getUnifierConfiguration() { + return impl.getUnifierConfiguration(); + } + + @Override + public UnifierConfiguration getDisambiguationUnifierConfiguration() { + return impl.getDisambiguationUnifierConfiguration(); + } + + @Override + public boolean isVariant() { + return impl.isVariant(); + } + + @Override + public boolean isExternal() { + return impl.isExternal(); + } + + public boolean equalsConsiderVariantsIfSpecified(Language otherLanguage) { + return impl.equalsConsiderVariantsIfSpecified(otherLanguage); + } + + @Override + public Pattern getIgnoredCharactersRegex() { + return impl.getIgnoredCharactersRegex(); + } + + @Override + public LanguageMaintainedState getMaintainedState() { + return impl.getMaintainedState(); + } + + @Override + public boolean isHiddenFromGui() { + return impl.isHiddenFromGui(); + } + + @Override + public int getRulePriority(Rule rule) { + return impl.getRulePriority(rule); + } + + @Override + public boolean isSpellcheckOnlyLanguage() { + return impl.isSpellcheckOnlyLanguage(); + } + + @Override + public boolean hasNGramFalseFriendRule(Language motherTongue) { + return impl.hasNGramFalseFriendRule(motherTongue); + } + + @Override + public String getOpeningDoubleQuote() { + return impl.getOpeningDoubleQuote(); + } + + @Override + public String getClosingDoubleQuote() { + return impl.getClosingDoubleQuote(); + } + + @Override + public String getOpeningSingleQuote() { + return impl.getOpeningSingleQuote(); + } + + @Override + public String getClosingSingleQuote() { + return impl.getClosingSingleQuote(); + } + + @Override + public boolean isAdvancedTypographyEnabled() { + return impl.isAdvancedTypographyEnabled(); + } + + @Override + public List adaptSuggestions(List ruleMatches, Set enabledRules) { + return impl.adaptSuggestions(ruleMatches, enabledRules); + } + + // XXX + + @Override + public void close() throws Exception { + if (impl instanceof AutoCloseable) { + ((AutoCloseable) impl).close(); + } + } + + @Override + public Function getRemoteEnhancedRules(ResourceBundle messageBundle, List configs, UserConfig userConfig, Language motherTongue, List altLanguages, boolean inputLogging) throws IOException { + return impl.getRemoteEnhancedRules(messageBundle, configs, userConfig, motherTongue, altLanguages, inputLogging); + } + + @Override + public String toAdvancedTypography(String input) { + return impl.toAdvancedTypography(input); + } + + @Override + public boolean hasMinMatchesRules() { + return impl.hasMinMatchesRules(); + } + + @Override + public String adaptSuggestion(String s) { + return impl.adaptSuggestion(s); + } + + @Override + public String getConsistencyRulePrefix() { + return impl.getConsistencyRulePrefix(); + } + + @Override + public RuleMatch adjustMatch(RuleMatch rm, List features) { + return impl.adjustMatch(rm, features); + } + + @Override + public List mergeSuggestions(List ruleMatches, AnnotatedText text, Set enabledRules) { + return impl.mergeSuggestions(ruleMatches, text, enabledRules); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/AmericanEnglish.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/AmericanEnglish.java new file mode 100644 index 000000000000..ff240973ac2e --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/AmericanEnglish.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 AmericanEnglish extends AbstractLanguageProxy { + public AmericanEnglish() { + super("org.languagetool.language.en.AmericanEnglish"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/AngolaPortuguese.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/AngolaPortuguese.java new file mode 100644 index 000000000000..62b19e7529c8 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/AngolaPortuguese.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 AngolaPortuguese extends AbstractLanguageProxy { + public AngolaPortuguese() { + super("org.languagetool.language.pt.AngolaPortuguese"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Arabic.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Arabic.java new file mode 100644 index 000000000000..d1c3b9d00839 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Arabic.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 Arabic extends AbstractLanguageProxy { + public Arabic() { + super("org.languagetool.language.ar.Arabic"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Asturian.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Asturian.java new file mode 100644 index 000000000000..b3158fb6c4c0 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Asturian.java @@ -0,0 +1,26 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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; + +@Deprecated +public class Asturian extends AbstractLanguageProxy { + public Asturian() { + super("org.languagetool.language.ast.Asturian"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/AustralianEnglish.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/AustralianEnglish.java new file mode 100644 index 000000000000..d709ce80b635 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/AustralianEnglish.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 AustralianEnglish extends AbstractLanguageProxy { + public AustralianEnglish() { + super("org.languagetool.language.en.AustralianEnglish"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/AustrianGerman.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/AustrianGerman.java new file mode 100644 index 000000000000..46276cfc3a6e --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/AustrianGerman.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 AustrianGerman extends AbstractLanguageProxy { + public AustrianGerman() { + super("org.languagetool.language.de.AustrianGerman"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/BalearicCatalan.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/BalearicCatalan.java new file mode 100644 index 000000000000..abca3225d303 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/BalearicCatalan.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 BalearicCatalan extends AbstractLanguageProxy { + public BalearicCatalan() { + super("org.languagetool.language.ca.BalearicCatalan"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/BelgianDutch.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/BelgianDutch.java new file mode 100644 index 000000000000..449b231f09f3 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/BelgianDutch.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 AbstractLanguageProxy { + public BelgianDutch() { + super("org.languagetool.language.nl.BelgianDutch"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/BelgianFrench.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/BelgianFrench.java new file mode 100644 index 000000000000..b0646fee44c3 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/BelgianFrench.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 BelgianFrench extends AbstractLanguageProxy { + public BelgianFrench() { + super("org.languagetool.language.fr.BelgianFrench"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/BrazilianPortuguese.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/BrazilianPortuguese.java new file mode 100644 index 000000000000..6f6bff4d2b66 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/BrazilianPortuguese.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 BrazilianPortuguese extends AbstractLanguageProxy { + public BrazilianPortuguese() { + super("org.languagetool.language.pt.BrazilianPortuguese"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Breton.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Breton.java new file mode 100644 index 000000000000..486bd4c6daa8 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Breton.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 Breton extends AbstractLanguageProxy { + public Breton() { + super("org.languagetool.language.br.Breton"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/BritishEnglish.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/BritishEnglish.java new file mode 100644 index 000000000000..fc67cfab5b93 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/BritishEnglish.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 BritishEnglish extends AbstractLanguageProxy { + public BritishEnglish() { + super("org.languagetool.language.en.BritishEnglish"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/CanadianEnglish.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/CanadianEnglish.java new file mode 100644 index 000000000000..75b1163b09d1 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/CanadianEnglish.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 CanadianEnglish extends AbstractLanguageProxy { + public CanadianEnglish() { + super("org.languagetool.language.en.CanadianEnglish"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/CanadianFrench.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/CanadianFrench.java new file mode 100644 index 000000000000..d9e8ef3993f2 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/CanadianFrench.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 CanadianFrench extends AbstractLanguageProxy { + public CanadianFrench() { + super("org.languagetool.language.fr.CanadianFrench"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Catalan.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Catalan.java new file mode 100644 index 000000000000..9288c9787e78 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Catalan.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 Catalan extends AbstractLanguageProxy { + public Catalan() { + super("org.languagetool.language.ca.Catalan"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Chinese.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Chinese.java new file mode 100644 index 000000000000..9ef9df41eacd --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Chinese.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 Chinese extends AbstractLanguageProxy { + public Chinese() { + super("org.languagetool.language.zh.Chinese"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Danish.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Danish.java new file mode 100644 index 000000000000..705a34803f6a --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Danish.java @@ -0,0 +1,26 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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; + +@Deprecated +public class Danish extends AbstractLanguageProxy { + public Danish() { + super("org.languagetool.language.da.Danish"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Dutch.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Dutch.java new file mode 100644 index 000000000000..1c5fda1792d3 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Dutch.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 Dutch extends AbstractLanguageProxy { + public Dutch() { + super("org.languagetool.language.nl.Dutch"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/English.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/English.java new file mode 100644 index 000000000000..2ca84d101f78 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/English.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 English extends AbstractLanguageProxy { + public English() { + super("org.languagetool.language.en.English"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Esperanto.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Esperanto.java new file mode 100644 index 000000000000..da18088b8314 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Esperanto.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 Esperanto extends AbstractLanguageProxy { + public Esperanto() { + super("org.languagetool.language.eo.Esperanto"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/French.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/French.java new file mode 100644 index 000000000000..ba7ec3f76edb --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/French.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 French extends AbstractLanguageProxy { + public French() { + super("org.languagetool.language.fr.French"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Galician.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Galician.java new file mode 100644 index 000000000000..c1fa2e8a9419 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Galician.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 Galician extends AbstractLanguageProxy { + public Galician() { + super("org.languagetool.language.gl.Galician"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/GermanyGerman.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/GermanyGerman.java new file mode 100644 index 000000000000..835065d14958 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/GermanyGerman.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 GermanyGerman extends AbstractLanguageProxy { + public GermanyGerman() { + super("org.languagetool.language.de.GermanyGerman"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Greek.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Greek.java new file mode 100644 index 000000000000..fb64f343db0f --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Greek.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 Greek extends AbstractLanguageProxy { + public Greek() { + super("org.languagetool.language.el.Greek"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Icelandic.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Icelandic.java new file mode 100644 index 000000000000..57e690399a98 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Icelandic.java @@ -0,0 +1,26 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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; + +@Deprecated +public class Icelandic extends AbstractLanguageProxy { + public Icelandic() { + super("org.languagetool.language.is.Icelandic"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Irish.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Irish.java new file mode 100644 index 000000000000..ecd967693ec8 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Irish.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 Irish extends AbstractLanguageProxy { + public Irish() { + super("org.languagetool.language.ga.Irish"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Italian.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Italian.java new file mode 100644 index 000000000000..df11bd12ff59 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Italian.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 Italian extends AbstractLanguageProxy { + public Italian() { + super("org.languagetool.language.it.Italian"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Japanese.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Japanese.java new file mode 100644 index 000000000000..d934e977ac80 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Japanese.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 Japanese extends AbstractLanguageProxy { + public Japanese() { + super("org.languagetool.language.ja.Japanese"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Khmer.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Khmer.java new file mode 100644 index 000000000000..2aa2416992dc --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Khmer.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 Khmer extends AbstractLanguageProxy { + public Khmer() { + super("org.languagetool.language.km.Khmer"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Lithuanian.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Lithuanian.java new file mode 100644 index 000000000000..dd2fff3ad629 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Lithuanian.java @@ -0,0 +1,26 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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; + +@Deprecated +public class Lithuanian extends AbstractLanguageProxy { + public Lithuanian() { + super("org.languagetool.language.lt.Lithuanian"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Malayalam.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Malayalam.java new file mode 100644 index 000000000000..82157d120cb9 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Malayalam.java @@ -0,0 +1,26 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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; + +@Deprecated +public class Malayalam extends AbstractLanguageProxy { + public Malayalam() { + super("org.languagetool.language.ml.Malayalam"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/MozambiquePortuguese.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/MozambiquePortuguese.java new file mode 100644 index 000000000000..a7a0d0a7da7f --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/MozambiquePortuguese.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 MozambiquePortuguese extends AbstractLanguageProxy { + public MozambiquePortuguese() { + super("org.languagetool.language.pt.MozambiquePortuguese"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/NewZealandEnglish.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/NewZealandEnglish.java new file mode 100644 index 000000000000..41db4004a0f4 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/NewZealandEnglish.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 NewZealandEnglish extends AbstractLanguageProxy { + public NewZealandEnglish() { + super("org.languagetool.language.en.NewZealandEnglish"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/NonSwissGerman.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/NonSwissGerman.java new file mode 100644 index 000000000000..2190985415bc --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/NonSwissGerman.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 NonSwissGerman extends AbstractLanguageProxy { + public NonSwissGerman() { + super("org.languagetool.language.de.NonSwissGerman"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Persian.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Persian.java new file mode 100644 index 000000000000..69b5f7b55030 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Persian.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 Persian extends AbstractLanguageProxy { + public Persian() { + super("org.languagetool.language.fa.Persian"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Polish.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Polish.java new file mode 100644 index 000000000000..942acd51a136 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Polish.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 Polish extends AbstractLanguageProxy { + public Polish() { + super("org.languagetool.language.pl.Polish"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/PortugalPortuguese.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/PortugalPortuguese.java new file mode 100644 index 000000000000..92f5c5e0e253 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/PortugalPortuguese.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 PortugalPortuguese extends AbstractLanguageProxy { + public PortugalPortuguese() { + super("org.languagetool.language.pt.PortugalPortuguese"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Portuguese.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Portuguese.java new file mode 100644 index 000000000000..c39c40315b7f --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Portuguese.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 Portuguese extends AbstractLanguageProxy { + public Portuguese() { + super("org.languagetool.language.pt.Portuguese"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Romanian.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Romanian.java new file mode 100644 index 000000000000..ce504627e7ea --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Romanian.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 Romanian extends AbstractLanguageProxy { + public Romanian() { + super("org.languagetool.language.ro.Romanian"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Russian.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Russian.java new file mode 100644 index 000000000000..531cb42360f3 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Russian.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 Russian extends AbstractLanguageProxy { + public Russian() { + super("org.languagetool.language.ru.Russian"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/SimpleGerman.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/SimpleGerman.java new file mode 100644 index 000000000000..777730664810 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/SimpleGerman.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 SimpleGerman extends AbstractLanguageProxy { + public SimpleGerman() { + super("org.languagetool.language.de_simple.SimpleGerman"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Slovak.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Slovak.java new file mode 100644 index 000000000000..cd2bf4e0d1a8 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Slovak.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 Slovak extends AbstractLanguageProxy { + public Slovak() { + super("org.languagetool.language.sk.Slovak"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Slovenian.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Slovenian.java new file mode 100644 index 000000000000..2b6e429ff826 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Slovenian.java @@ -0,0 +1,26 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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; + +@Deprecated +public class Slovenian extends AbstractLanguageProxy { + public Slovenian() { + super("org.languagetool.language.sl.Slovenian"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/SouthAfricanEnglish.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/SouthAfricanEnglish.java new file mode 100644 index 000000000000..af6b1b7f3578 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/SouthAfricanEnglish.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 SouthAfricanEnglish extends AbstractLanguageProxy { + public SouthAfricanEnglish() { + super("org.languagetool.language.en.SouthAfricanEnglish"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Spanish.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Spanish.java new file mode 100644 index 000000000000..4a6ac6c6f251 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Spanish.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 Spanish extends AbstractLanguageProxy { + public Spanish() { + super("org.languagetool.language.es.Spanish"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/SpanishVoseo.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/SpanishVoseo.java new file mode 100644 index 000000000000..653890db673f --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/SpanishVoseo.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 SpanishVoseo extends AbstractLanguageProxy { + public SpanishVoseo() { + super("org.languagetool.language.es.SpanishVoseo"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Swedish.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Swedish.java new file mode 100644 index 000000000000..8007542026f7 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Swedish.java @@ -0,0 +1,26 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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; + +@Deprecated +public class Swedish extends AbstractLanguageProxy { + public Swedish() { + super("org.languagetool.language.sv.Swedish"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/SwissFrench.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/SwissFrench.java new file mode 100644 index 000000000000..fb3c9fe99201 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/SwissFrench.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 SwissFrench extends AbstractLanguageProxy { + public SwissFrench() { + super("org.languagetool.language.fr.SwissFrench"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/SwissGerman.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/SwissGerman.java new file mode 100644 index 000000000000..268c2bc7cf60 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/SwissGerman.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 SwissGerman extends AbstractLanguageProxy { + public SwissGerman() { + super("org.languagetool.language.de.SwissGerman"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Tagalog.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Tagalog.java new file mode 100644 index 000000000000..02f324ae1165 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Tagalog.java @@ -0,0 +1,26 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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; + +@Deprecated +public class Tagalog extends AbstractLanguageProxy { + public Tagalog() { + super("org.languagetool.language.tl.Tagalog"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Tamil.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Tamil.java new file mode 100644 index 000000000000..450a78332da5 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Tamil.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 Tamil extends AbstractLanguageProxy { + public Tamil() { + super("org.languagetool.language.ta.Tamil"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Ukrainian.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Ukrainian.java new file mode 100644 index 000000000000..3e6dad1bf1d8 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Ukrainian.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 Ukrainian extends AbstractLanguageProxy { + public Ukrainian() { + super("org.languagetool.language.uk.Ukrainian"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Ukrainian1992.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Ukrainian1992.java new file mode 100644 index 000000000000..f668fb395e9e --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/Ukrainian1992.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 Ukrainian1992 extends AbstractLanguageProxy { + public Ukrainian1992() { + super("org.languagetool.language.uk.Ukrainian1992"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/ValencianCatalan.java b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/ValencianCatalan.java new file mode 100644 index 000000000000..1a253ccebdcd --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/main/java/org/languagetool/language/ValencianCatalan.java @@ -0,0 +1,25 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2023 Hiroshi Miura + * + * 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 ValencianCatalan extends AbstractLanguageProxy { + public ValencianCatalan() { + super("org.languagetool.language.ca.ValencianCatalan"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/BretonTest.java b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/BretonTest.java new file mode 100644 index 000000000000..f564d59f38d5 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/BretonTest.java @@ -0,0 +1,39 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2019 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; + +import org.junit.Test; +import org.languagetool.LanguageSpecificTest; + +import java.io.IOException; +import java.util.Arrays; + +public class BretonTest extends LanguageSpecificTest { + + @Test + public void testLanguage() throws IOException { + // NOTE: this text needs to be kept in sync with config.ts -> DEMO_TEXTS: + String s = "Lakait amañ ho testenn vrezhonek da vezañ gwiriet. Pe implijit an frazenn-mañ gant meur a fazioù yezhadurel enni."; + Breton lang = new Breton(); + testDemoText(lang, s, + Arrays.asList("AR", "LIES") + ); + runTests(lang, "br"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/CatalanTest.java b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/CatalanTest.java new file mode 100644 index 000000000000..f30bcf83fb85 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/CatalanTest.java @@ -0,0 +1,111 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2005 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; + +import org.junit.Test; +import org.languagetool.JLanguageTool; +import org.languagetool.Language; +import org.languagetool.rules.RuleMatch; + +import java.io.IOException; +import java.util.List; + +import static org.junit.Assert.assertEquals; + +public class CatalanTest { + + @Test + public void testCleanOverlappingErrors() throws IOException { + Language lang = new Catalan(); + JLanguageTool tool = new JLanguageTool(lang); + List matches = tool.check("prosper"); + assertEquals(1, matches.size()); + assertEquals("CA_SIMPLE_REPLACE_BALEARIC_PROSPER", matches.get(0).getRule().getId()); + + matches = tool.check("Potser siga el millor"); + assertEquals(1, matches.size()); + assertEquals("POTSER_SIGUI", matches.get(0).getRule().getId()); + + //ChunkTags + + assertEquals("[ Ho[ho/PP3NN000] deu[deure/VMIP3S00,GV] haver[haver/VAN00000,haver/_GV_,haver/_perfet,GV] tornat[tornar/VMP00SM0,GV] a[a/SPS00,GV] fer[fer/VMN00000,fer/complement,GV].[./_PUNCT,

]]", + tool.analyzeText("Ho deu haver tornat a fer.").toString()); + + + assertEquals("[ Ho[ho/PP3NN000] he[haver/VAIP1S00,haver/_obligacio,GV] de[de/SPS00,GV] continuar[continuar/VMN00000,continuar/_GV_,GV] fent[fer/VMG00000,fent/_GV_,GV] així[així/RG].[./_PUNCT,

]]", + tool.analyzeText("Ho he de continuar fent així.").toString()); + + } + + @Test + public void testValecianVariant() throws IOException { + Language lang = new ValencianCatalan(); + JLanguageTool tool = new JLanguageTool(lang); + List matches = tool.check("Cal usar mètodes d'anàlisi adequats."); + assertEquals(0, matches.size()); + } + + @Test + public void testBalearicVariant() throws IOException { + Language lang = new BalearicCatalan(); + JLanguageTool tool = new JLanguageTool(lang); + List matches = tool.check("Cal usar mètodes d'anàlisi adequats."); + assertEquals(0, matches.size()); + } + + @Test + public void testAdvancedTypography() throws IOException { + Language lang = new Catalan(); + assertEquals(lang.toAdvancedTypography("És l'\"hora\"!"), "És l’«hora»!"); + assertEquals(lang.toAdvancedTypography("És l''hora'!"), "És l’‘hora’!"); + assertEquals(lang.toAdvancedTypography("És l'«hora»!"), "És l’«hora»!"); + assertEquals(lang.toAdvancedTypography("És l''hora'."), "És l’‘hora’."); + assertEquals(lang.toAdvancedTypography("Cal evitar el \"'lo' neutre\"."), "Cal evitar el «‘lo’ neutre»."); + assertEquals(lang.toAdvancedTypography("És \"molt 'important'\"."), "És «molt ‘important’»."); + assertEquals(lang.toAdvancedTypography("Si és del v. 'haver'."), "Si és del v.\u00a0‘haver’."); + assertEquals(lang.toAdvancedTypography("Amb el so de 's'."), "Amb el so de ‘s’."); + + assertEquals(lang.adaptSuggestion("L'IEC"), "L'IEC"); + assertEquals(lang.adaptSuggestion("te estimava"), "t'estimava"); + assertEquals(lang.adaptSuggestion("el Albert"), "l'Albert"); + assertEquals(lang.adaptSuggestion("l'Albert"), "l'Albert"); + assertEquals(lang.adaptSuggestion("l'«Albert»"), "l'«Albert»"); + assertEquals(lang.adaptSuggestion("l’«Albert»"), "l’«Albert»"); + assertEquals(lang.adaptSuggestion("l'\"Albert\""), "l'\"Albert\""); + assertEquals(lang.adaptSuggestion("m'tancava"), "em tancava"); + assertEquals(lang.adaptSuggestion("s'tancava"), "es tancava"); + assertEquals(lang.adaptSuggestion("l'R+D"), "l'R+D"); + assertEquals(lang.adaptSuggestion("l'FBI"), "l'FBI"); + + } + + @Test + public void testAdaptSuggestions() throws IOException { + JLanguageTool tool = new JLanguageTool(new Catalan()); + List matches = tool.check( + "Els valencians hem sigut valencians des que Jaume I creà el regne de València i poc a poc es conformà una nova identitat política (que en l'edat mitjana, per exemple, no entrava en contradicció amb la consciència clara que teníem un origen i una llengua comuns amb els catalans)."); + assertEquals(matches.get(0).getSuggestedReplacements().toString(), "[a poc a poc]"); + + matches = tool.check("A nivell d'ensenyament superior."); + assertEquals(matches.get(0).getSuggestedReplacements().toString(), + "[En l'àmbit d', A escala d', A , En , Pel que fa a , Quant a ]"); + + } + +} diff --git a/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/ChineseTest.java b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/ChineseTest.java new file mode 100644 index 000000000000..acb1edcbc445 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/ChineseTest.java @@ -0,0 +1,39 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2019 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; + +import org.junit.Test; +import org.languagetool.LanguageSpecificTest; + +import java.io.IOException; +import java.util.Arrays; + +public class ChineseTest extends LanguageSpecificTest { + + @Test + public void testLanguage() throws IOException { + // NOTE: this text needs to be kept in sync with config.ts -> DEMO_TEXTS: + String s = "将文本粘贴在此,或者检测以下文本:我和她去看了二部电影。"; + Chinese lang = new Chinese(); + testDemoText(lang, s, + Arrays.asList("wa5") + ); + runTests(lang, "zh"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/DanishTest.java b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/DanishTest.java new file mode 100644 index 000000000000..ede1e3dc3d20 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/DanishTest.java @@ -0,0 +1,39 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2019 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; + +import org.junit.Test; +import org.languagetool.LanguageSpecificTest; + +import java.io.IOException; +import java.util.Arrays; + +public class DanishTest extends LanguageSpecificTest { + + @Test + public void testLanguage() throws IOException { + // NOTE: this text needs to be kept in sync with config.ts -> DEMO_TEXTS: + String s = "Indsæt din egen tekst her , eller brug denne tekst for at se nogle af de fejl LanguageTool fanger. vær opmærksom på at den langtfra er er perfect, men skal være en hjælp til at få standartfejl frem i lyset."; + Danish lang = new Danish(); + testDemoText(lang, s, + Arrays.asList("COMMA_PARENTHESIS_WHITESPACE", "UPPERCASE_SENTENCE_START", "Ordgentagelse", "HUNSPELL_RULE", "standart_standard") + ); + runTests(lang, "da"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/DutchTest.java b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/DutchTest.java new file mode 100644 index 000000000000..2545b12e5635 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/DutchTest.java @@ -0,0 +1,54 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2005 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; + +import org.junit.Test; +import org.languagetool.JLanguageTool; +import org.languagetool.Language; + +import java.io.IOException; + +import static org.junit.Assert.assertEquals; + +public class DutchTest { + + @Test + public void testDutch() throws IOException { + final JLanguageTool tool = new JLanguageTool(new Dutch()); + /* this is in the way, since I am using rules to experiment with possible disambiguation pattern, to check if they are good enough + assertEquals(0, tool.check("Een test, die geen fouten mag geven.").size()); + */ + //assertEquals(1, tool.check("Dit is fout.!").size()); + //test uppercasing rule: + /* + matches = tool.check("De Afdeling Beheer kan het"); + assertEquals(1, matches.size()); + assertEquals("Als Afdeling geen deel uitmaakt van de naam, dan is juist:afdeling", matches.get(0).getMessage()); + */ + // Dutch rule has no effect with English error but they are spelling mistakes: + assertEquals(1, tool.check("Hier staat een spelvout voor testdoeleinden.").size()); + } + + @Test + public void testAdvancedTypography() throws IOException { + Language lang = new Dutch(); + assertEquals(lang.toAdvancedTypography("\"Fatima zei 'Hallo' tegen me.\""), "“Fatima zei ‘Hallo’ tegen me.”"); + assertEquals(lang.toAdvancedTypography("Bedoelt u wellicht \"vivo's\"?"), "Bedoelt u wellicht “vivo’s”?"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/EnglishTest.java b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/EnglishTest.java new file mode 100644 index 000000000000..65b33cc3c5af --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/EnglishTest.java @@ -0,0 +1,336 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2005 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; + +import org.junit.Ignore; +import org.junit.Test; +import org.languagetool.*; +import org.languagetool.JLanguageTool.ParagraphHandling; +import org.languagetool.markup.AnnotatedText; +import org.languagetool.markup.AnnotatedTextBuilder; +import org.languagetool.rules.*; +import org.languagetool.rules.patterns.PatternRule; +import org.languagetool.rules.patterns.PatternToken; +import org.languagetool.rules.spelling.SpellingCheckRule; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +import static org.hamcrest.core.Is.is; +import static org.junit.Assert.*; + +public class EnglishTest { + + @Ignore("not a test, but used on https://dev.languagetool.org/java-api") + @Test + public void demoCodeForHomepage() throws IOException { + JLanguageTool lt = new JLanguageTool(new BritishEnglish()); + // comment in to use statistical ngram data: + //lt.activateLanguageModelRules(new File("/data/google-ngram-data")); + List matches = lt.check("A sentence with a error in the Hitchhiker's Guide tot he Galaxy"); + for (RuleMatch match : matches) { + System.out.println("Potential error at characters " + + match.getFromPos() + "-" + match.getToPos() + ": " + + match.getMessage()); + System.out.println("Suggested correction(s): " + + match.getSuggestedReplacements()); + } + } + + @Ignore("not a test, but used on https://dev.languagetool.org/java-spell-checker") + @Test + public void spellCheckerDemoCodeForHomepage() throws IOException { + JLanguageTool lt = new JLanguageTool(new BritishEnglish()); + for (Rule rule : lt.getAllRules()) { + if (!rule.isDictionaryBasedSpellingRule()) { + lt.disableRule(rule.getId()); + } + } + List matches = lt.check("A speling error"); + for (RuleMatch match : matches) { + System.out.println("Potential typo at characters " + + match.getFromPos() + "-" + match.getToPos() + ": " + + match.getMessage()); + System.out.println("Suggested correction(s): " + + match.getSuggestedReplacements()); + } + } + + @Ignore("not a test, but used on https://dev.languagetool.org/java-spell-checker") + @Test + public void spellCheckerDemoCodeForHomepageWithAddedWords() throws IOException { + JLanguageTool lt = new JLanguageTool(new BritishEnglish()); + for (Rule rule : lt.getAllRules()) { + if (rule instanceof SpellingCheckRule) { + ((SpellingCheckRule) rule).addIgnoreTokens(Arrays.asList("myspecialword", "anotherspecialword")); + } + } + List matches = lt.check("These are myspecialword and anotherspecialword"); + System.out.println(matches.size() + " matches"); // => "0 matches" + } + + @Test + public void testEnglish() throws IOException { + //more error-free sentences to deal with possible regressions + if (System.getProperty("disableHardcodedTests") == null) { + JLanguageTool lt = new JLanguageTool(new English()); + assertNoError("A test that should not give errors.", lt); + assertNoError("As long as you have hope, a chance remains.", lt); + assertNoError("A rolling stone gathers no moss.", lt); + assertNoError("Hard work causes fitness.", lt); + assertNoError("Gershwin overlays the slow blues theme from section B in the final “Grandioso.”", lt); + assertNoError("Making ingroup membership more noticeable increases cooperativeness.", lt); + assertNoError("Dog mushing is more of a sport than a true means of transportation.", lt); + assertNoError("No one trusts him any more.", lt); + assertNoError("A member of the United Nations since 1992, Azerbaijan was elected to membership in the newly established Human Rights Council by the United Nations General Assembly on May 9, 2006 (the term of office began on June 19, 2006).", lt); + assertNoError("Anatomy and geometry are fused in one, and each does something to the other.", lt); + assertNoError("Certain frogs that lay eggs underground have unpigmented eggs.", lt); + assertNoError("It's a kind of agreement in which each party gives something to the other, Jack said.", lt); + assertNoError("Later, you shall know it better.", lt); + assertNoError("And the few must win what the many lose, for the opposite arrangement would not support markets as we know them at all, and is, in fact, unimaginable.", lt); + assertNoError("He explained his errand, but without bothering much to make it plausible, for he felt something well up in him which was the reason he had fled the army.", lt); + assertNoError("I think it's better, and it's not a big deal.", lt); + + // with hidden characters, separated with annotated text + assertNoError("This\u202D\u202C \u202D\u202Cis\u202D\u202C \u202D\u202Ca\u202D\u202C " + + "\u202D\u202Ctest\u202D\u202C \u202D\u202Csentence,\u202D\u202C \u202D\u202Cwith" + + "\u202D\u202C \u202D\u202Cstrange\u202D\u202C \u202D\u202Chidden\u202D\u202C \u202D\u202Ccharacters.", lt); + + assertOneError("A test test that should give errors.", lt); + assertOneError("I can give you more a detailed description.", lt); + assertTrue(lt.getAllRules().size() > 1000); + assertNoError("The sea ice is highly variable — frozen solid during cold, calm weather and broke...", lt); + assertTrue(lt.getAllRules().size() > 3); + assertOneError("I can give you more a detailed description.", lt); + lt.disableRule("MORE_A_JJ"); + assertNoError("I can give you more a detailed description.", lt); + assertOneError("I've go to go.", lt); + lt.disableCategory(Categories.TYPOS.getId()); + if (Premium.isPremiumVersion()) { + assertOneError("I've go to go.", lt); + } else { + assertNoError("I've go to go.", lt); + } + + // Passive voice: repetitions + // the first match is at a long distance + assertNoError( + "The territory of Metropolitan France was settled by Celtic tribes known as Gauls. France reached its political and military zenith in the early 19th century under Napoleon Bonaparte, subjugating much of continental Europe and establishing the First French Empire. The French Revolutionary and Napoleonic Wars shaped the course of European and world history. The collapse of the empire initiated a period of relative decline, in which France endured a tumultuous succession of governments until the founding of the French Third Republic during the Franco-Prussian War in 1870. Subsequent decades saw a period of optimism, cultural and scientific flourishing, as well as economic prosperity known as the Belle Époque. France was one of the major participants of World War I, from which it emerged victorious at great human and economic cost. It was among the Allied powers of World War II, but was soon occupied by the Axis in 1940. France was plunged into a series of dynastic conflicts involving England. The second half of the 16th century was dominated by religious civil wars. The short-lived Fourth Republic was established and later dissolved during the Algerian War. The current Fifth Republic was formed in 1958 by Charles de Gaulle.", + lt); + // 4 previous matches within 80 tokens + assertOneError( + "The territory of Metropolitan France was settled by Celtic tribes known as Gauls. France was plunged into a series of dynastic conflicts involving England. The second half of the 16th century was dominated by religious civil wars. The short-lived Fourth Republic was established and later dissolved during the Algerian War. The current Fifth Republic was formed in 1958 by Charles de Gaulle. ", + lt); + } + } + + private void assertNoError(String input, JLanguageTool lt) throws IOException { + List matches = lt.check(input); + assertEquals("Did not expect an error in test sentence: '" + input + "', but got: " + matches, 0, matches.size()); + } + + private void assertOneError(String input, JLanguageTool lt) throws IOException { + List matches = lt.check(input); + assertEquals("Did expect 1 error in test sentence: '" + input + "', but got: " + matches, 1, matches.size()); + } + + @Test + public void testPositionsWithEnglish() throws IOException { + JLanguageTool tool = new JLanguageTool(new AmericanEnglish()); + List matches = tool.check("A sentence with no period\n" + + "A sentence. A typoh."); + assertEquals(1, matches.size()); + RuleMatch match = matches.get(0); + assertEquals(1, match.getLine()); + assertEquals(15, match.getColumn()); + } + + @Test + public void testPositionsWithEnglishTwoLineBreaks() throws IOException { + JLanguageTool tool = new JLanguageTool(new AmericanEnglish()); + List matches = tool.check("This sentence.\n\n" + + "A sentence. A typoh."); + assertEquals(1, matches.size()); + RuleMatch match = matches.get(0); + assertEquals(2, match.getLine()); + // It was 14. It should actually be 15, as in testPositionsWithEnglish(). + // Fixed thanks to a change in the sentence split. + if (Premium.isPremiumVersion()) { + // TODO: there should be no difference here + assertEquals(14, match.getColumn()); + } else { + assertEquals(15, match.getColumn()); + } + } + + @Test + public void testAnalyzedSentence() throws IOException { + JLanguageTool tool = new JLanguageTool(new English()); + //test soft-hyphen ignoring: + assertEquals(" This[this/DT,B-NP-singular|E-NP-singular] " + + "is[be/VBZ,B-VP] a[a/DT,B-NP-singular] " + + "test­ed[tested/JJ,I-NP-singular] " + + "sentence[sentence/NN,E-NP-singular].[./.,./PCT,O]", + tool.getAnalyzedSentence("This is a test\u00aded sentence.").toString()); + //test paragraph ends adding + assertEquals("

", tool.getAnalyzedSentence("\n").toString()); + + //test vertical tab as white space + String sentence = "I'm a cool test\u000Bwith a line"; + AnalyzedSentence aSentence = tool.getAnalyzedSentence(sentence); + assertEquals(aSentence.getTokens()[9].isWhitespace(), true); + assertEquals(aSentence.getTokens()[10].isWhitespaceBefore(), true); + } + + @Test + public void testParagraphRules() throws IOException { + JLanguageTool tool = new JLanguageTool(new English()); + + //run normally + List matches1 = tool.check("(This is an quote.\n It ends in the second sentence."); + assertEquals(2, matches1.size()); + + //run in a sentence-only mode + List matches2 = tool.check("(This is an quote.\n It ends in the second sentence.", false, ParagraphHandling.ONLYNONPARA); + assertEquals(1, matches2.size()); + assertEquals("EN_A_VS_AN", matches2.get(0).getRule().getId()); + + //run in a paragraph mode - single sentence + List matches3 = tool.check("(This is an quote.\n It ends in the second sentence.", false, ParagraphHandling.ONLYPARA); + assertEquals(1, matches3.size()); + assertEquals("EN_UNPAIRED_BRACKETS", matches3.get(0).getRule().getId()); + + //run in a paragraph mode - many sentences + List matches4 = tool.check("(This is an quote.\n It ends in the second sentence.", true, ParagraphHandling.ONLYPARA); + assertEquals(1, matches4.size()); + assertEquals("EN_UNPAIRED_BRACKETS", matches4.get(0).getRule().getId()); + } + + @Test + public void testWhitespace() throws IOException { + JLanguageTool tool = new JLanguageTool(new English()); + AnalyzedSentence raw = tool.getRawAnalyzedSentence("Let's do a \"test\", do you understand?"); + AnalyzedSentence cooked = tool.getAnalyzedSentence("Let's do a \"test\", do you understand?"); + //test if there was a change + assertFalse(raw.equals(cooked)); + //see if nothing has been deleted + assertEquals(raw.getTokens().length, cooked.getTokens().length); + int i = 0; + for (AnalyzedTokenReadings atr : raw.getTokens()) { + assertEquals(atr.isWhitespaceBefore(), + cooked.getTokens()[i].isWhitespaceBefore()); + i++; + } + } + + @Test + public void testOverlapFilter() throws IOException { + Category category = new Category(new CategoryId("TEST_ID"), "test category"); + List elements1 = Arrays.asList(new PatternToken("one", true, false, false)); + PatternRule rule1 = new PatternRule("id1", new English(), elements1, "desc1", "msg1", "shortMsg1"); + rule1.setSubId("1"); + rule1.setCategory(category); + + List elements2 = Arrays.asList(new PatternToken("one", true, false, false), new PatternToken("two", true, false, false)); + PatternRule rule2 = new PatternRule("id1", new English(), elements2, "desc2", "msg2", "shortMsg2"); + rule2.setSubId("2"); + rule2.setCategory(category); + + JLanguageTool tool = new JLanguageTool(new English()); + tool.addRule(rule1); + tool.addRule(rule2); + + List ruleMatches1 = tool.check("And one two three."); + assertEquals("one overlapping rule must be filtered out", 1, ruleMatches1.size()); + assertEquals("msg1", ruleMatches1.get(0).getMessage()); + + String sentence = "And one two three."; + AnalyzedSentence analyzedSentence = tool.getAnalyzedSentence(sentence); + List bothRules = new ArrayList<>(Arrays.asList(rule1, rule2)); + List ruleMatches2 = tool.checkAnalyzedSentence(ParagraphHandling.NORMAL, bothRules, analyzedSentence, true); + assertEquals("one overlapping rule must be filtered out", 1, ruleMatches2.size()); + assertEquals("msg1", ruleMatches2.get(0).getMessage()); + } + + @Test + public void testTextLevelRuleWithGlobalData() throws IOException { + JLanguageTool tool = new JLanguageTool(new English()); + tool.addRule(new MyTextLevelRule()); + AnnotatedText text1 = new AnnotatedTextBuilder().addGlobalMetaData(AnnotatedText.MetaDataKey.EmailToAddress, "Foo Bar ").build(); + assertThat(tool.check(text1).size(), is(1)); + AnnotatedText text2 = new AnnotatedTextBuilder().addGlobalMetaData(AnnotatedText.MetaDataKey.EmailToAddress, "blah blah ").build(); + assertThat(tool.check(text2).size(), is(0)); + } + + class MyTextLevelRule extends TextLevelRule { + @Override + public RuleMatch[] match(List sentences, AnnotatedText text) throws IOException { + if (text.getGlobalMetaData(AnnotatedText.MetaDataKey.EmailToAddress, "").contains("Foo Bar")) { + return new RuleMatch[]{new RuleMatch(this, null, 0, 1, "test message")}; + } + return new RuleMatch[0]; + } + @Override + public RuleMatch[] match(List sentences) throws IOException { + throw new RuntimeException("not implemented"); + } + @Override + public String getId() { + return "MyTextLevelRule"; + } + @Override + public String getDescription() { + return "Test rule"; + } + @Override + public int minToCheckParagraph() { + return -1; + } + } + + @Test + public void testAdvancedTypography() { + Language lang = new AmericanEnglish(); + assertEquals(lang.toAdvancedTypography("The genitive ('s) may be missing."), "The genitive (’s) may be missing."); + assertEquals(lang.toAdvancedTypography("The word 'Language‘s' is not standard English"), "The word ‘Language‘s’ is not standard English"); + assertEquals(lang.toAdvancedTypography("Did you mean Language's (straight apostrophe) or Language’s (curly apostrophe)?"), "Did you mean “Language's” (straight apostrophe) or “Language’s” (curly apostrophe)?"); + assertEquals(lang.toAdvancedTypography("Did you mean Language’s (curly apostrophe) or Language's (straight apostrophe)?"), "Did you mean “Language’s” (curly apostrophe) or “Language's” (straight apostrophe)?"); + assertEquals(lang.toAdvancedTypography("Did you mean |?"), "Did you mean “|?”"); + } + + @Test + public void testAdaptSuggestions() throws IOException { + JLanguageTool tool = new JLanguageTool(new AmericanEnglish()); + List matches = tool.check("Whatever their needs, we doesn't never disappoint them."); + assertEquals("[n't, never]", matches.get(0).getSuggestedReplacements().toString()); + } + + @Test + public void testEnglishVariants() throws IOException { + String sentence = "This is a test."; + String sentence2 = "This is an test."; + for (String langCode : new String[] { "en-US", "en-AU", "en-GB", "en-CA", "en-ZA", "en-NZ" }) { + JLanguageTool lt = new JLanguageTool(Languages.getLanguageForShortCode(langCode)); + assertEquals(0, lt.check(sentence).size()); + assertEquals(1, lt.check(sentence2).size()); + } + } +} diff --git a/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/EsperantoTest.java b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/EsperantoTest.java new file mode 100644 index 000000000000..54dd2c8a1f88 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/EsperantoTest.java @@ -0,0 +1,46 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2013 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; + +import org.junit.Test; +import org.languagetool.JLanguageTool; +import org.languagetool.LanguageSpecificTest; +import org.languagetool.language.Esperanto; +import org.languagetool.rules.RuleMatch; + +import java.io.IOException; +import java.util.List; + +import static org.hamcrest.CoreMatchers.is; +import static org.junit.Assert.assertThat; + +public class EsperantoTest extends LanguageSpecificTest { + + @Test + public void testLanguage() throws IOException { + Esperanto language = new Esperanto(); + runTests(language, "eo"); + JLanguageTool languageTool = new JLanguageTool(language); + String input = "La Mondaj Ludoj de 2013 estis plur-sporta evento..."; + List ruleMatches = languageTool.check(input); + assertThat(ruleMatches.size(), is(1)); + assertThat(ruleMatches.get(0).getRule().getId(), is("HUNSPELL_RULE")); + } + +} diff --git a/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/FrenchTest.java b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/FrenchTest.java new file mode 100644 index 000000000000..e357b285ade7 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/FrenchTest.java @@ -0,0 +1,75 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2019 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; + +import org.junit.Test; +import org.languagetool.JLanguageTool; +import org.languagetool.Language; +import org.languagetool.rules.RuleMatch; +import org.languagetool.tokenizers.SentenceTokenizer; + +import java.io.IOException; +import java.util.List; + +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.junit.Assert.assertEquals; + +public class FrenchTest { + + @Test + public void testSentenceTokenizer() { + Language lang = new French(); + SentenceTokenizer tokenizer = lang.getSentenceTokenizer(); + assertThat(tokenizer.tokenize("Arrête de le cajoler... ça ne donnera rien.").size(), is(1)); + assertThat(tokenizer.tokenize("Arrête de le cajoler… ça ne donnera rien.").size(), is(1)); + assertThat(tokenizer.tokenize("Il est possible de le contacter par tous les moyens (courrier, téléphone, mail...) à condition de vous présenter.").size(), is(1)); + } + + @Test + public void testAdvancedTypography() { + Language lang = new French(); + assertEquals(lang.toAdvancedTypography("\"C'est\""), "«\u00a0C’est\u00a0»"); + assertEquals(lang.toAdvancedTypography("\"C'est\" "), "«\u00a0C’est\u00a0» "); + assertEquals(lang.toAdvancedTypography("'C'est'"), "‘C’est’"); + assertEquals(lang.toAdvancedTypography("Vouliez-vous dire 'C'est'?"), "Vouliez-vous dire ‘C’est’\u202f?"); + assertEquals(lang.toAdvancedTypography("Vouliez-vous dire \"C'est\"?"), "Vouliez-vous dire «\u00a0C’est\u00a0»\u202f?"); + assertEquals(lang.toAdvancedTypography("Vouliez-vous dire C'est?"), "Vouliez-vous dire «\u00a0C’est\u00a0»\u202f?"); + assertEquals(lang.toAdvancedTypography("Confusion possible : \"a\" est une conjugaison du verbe avoir. Vouliez-vous dire « à »?"), + "Confusion possible\u00a0: «\u00a0a\u00a0» est une conjugaison du verbe avoir. Vouliez-vous dire «\u00a0à\u00a0»\u202f?"); + assertEquals(lang.toAdvancedTypography("C'est l'\"homme\"."), "C’est l’« homme »."); + assertEquals(lang.toAdvancedTypography("Vouliez-vous dire 50\u00a0$?"), "Vouliez-vous dire «\u00a050\u00a0$\u00a0»\u202f?"); + } + + @Test + public void testRules() throws IOException { + Language lang = new French(); + JLanguageTool lt = new JLanguageTool(lang); + + // In some (unclear) circumstances, matches in these sentences and rules are not detected by tests on XML examples #6300 + + // FRENCH_WORD_REPEAT_RULE[2] + List matches = lt.check("Fête des mères et remise de l'insigne \" Morts pour la France \"."); + assertEquals(0, matches.size()); + // ACCORD_V_QUESTION2[1] + List matches2 = lt.check("D'autre part, je ne soutiens pas du tout le système actuel en france mais je sais qu'au train où l'on va que notre prochaine étape sera celle de la Grèce ou de l'Argentine."); + assertEquals(1, matches2.size()); + } + +} diff --git a/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/GalicianTest.java b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/GalicianTest.java new file mode 100644 index 000000000000..dcbd89b6cc1d --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/GalicianTest.java @@ -0,0 +1,39 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2019 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; + +import org.junit.Test; +import org.languagetool.LanguageSpecificTest; + +import java.io.IOException; +import java.util.Arrays; + +public class GalicianTest extends LanguageSpecificTest { + + @Test + public void testLanguage() throws IOException { + // NOTE: this text needs to be kept in sync with config.ts -> DEMO_TEXTS: + String s = "Esta vai a ser unha mostra de de exemplo para amosar o funcionamento de LanguageTool."; + Galician lang = new Galician(); + testDemoText(lang, s, + Arrays.asList("IR_A_INF", "WORD_REPETITION", "WHITESPACE_RULE") + ); + runTests(lang, "ga"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/GermanTest.java b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/GermanTest.java new file mode 100644 index 000000000000..208082632a43 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/GermanTest.java @@ -0,0 +1,75 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2005 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; + +import org.junit.Test; +import org.languagetool.JLanguageTool; +import org.languagetool.Premium; +import org.languagetool.rules.RuleMatch; + +import java.io.IOException; +import java.util.List; + +import static org.junit.Assert.assertEquals; + +public class GermanTest { + + @Test + public void testGermanyGerman() throws IOException { + JLanguageTool lt = new JLanguageTool(new GermanyGerman()); + assertEquals(0, lt.check("Ein Test, der keine Fehler geben sollte.").size()); + assertEquals(1, lt.check("Ein Test Test, der Fehler geben sollte.").size()); + lt.setListUnknownWords(true); + // German rule has no effect with English error, but they are spelling mistakes: + if (Premium.isPremiumVersion()) { + assertEquals(7, lt.check("I can give you more a detailed description").size()); + } else { + assertEquals(6, lt.check("I can give you more a detailed description").size()); + } + //test unknown words listing + assertEquals("[I, can, description, detailed, give, more, you]", lt.getUnknownWords().toString()); + } + + @Test + public void testPositionsWithGerman() throws IOException { + JLanguageTool lt = new JLanguageTool(new GermanyGerman()); + List matches = lt.check("Stundenkilometer"); + assertEquals(1, matches.size()); + RuleMatch match = matches.get(0); + assertEquals(0, match.getLine()); + assertEquals(1, match.getColumn()); + } + + @Test + public void testGermanVariants() throws IOException { + String sentence = "Ein Test, der keine Fehler geben sollte."; + String sentence2 = "Ein Test Test, der Fehler geben sollte."; + JLanguageTool lt = new JLanguageTool(new GermanyGerman()); + assertEquals(0, lt.check(sentence).size()); + assertEquals(1, lt.check(sentence2).size()); + + lt = new JLanguageTool(new SwissGerman()); + assertEquals(0, lt.check(sentence).size()); + assertEquals(1, lt.check(sentence2).size()); + + lt = new JLanguageTool(new AustrianGerman()); + assertEquals(0, lt.check(sentence).size()); + assertEquals(1, lt.check(sentence2).size()); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/GreekTest.java b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/GreekTest.java new file mode 100644 index 000000000000..5b43d22d65a1 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/GreekTest.java @@ -0,0 +1,39 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2019 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; + +import org.junit.Test; +import org.languagetool.LanguageSpecificTest; + +import java.io.IOException; +import java.util.Arrays; + +public class GreekTest extends LanguageSpecificTest { + + @Test + public void testLanguage() throws IOException { + // NOTE: this text needs to be kept in sync with config.ts -> DEMO_TEXTS: + String s = "Επικολλήστε το κείμενο σας εδώ και κάντε κλικ στο κουμπί ελέγχου. Κάντε κλικ στις χρωματιστές φράσεις για λεπτομέρειες σχετικά με πιθανά σφάλματα. Για παράδειγμα σε αυτή τη πρόταση υπάρχουν εσκεμμένα λάθη για να να δείτε πώς λειτουργει το LanguageTool.."; + Greek lang = new Greek(); + testDemoText(lang, s, + Arrays.asList("GREEK_PUNC_2", "GREEK_ART_FEM_MISSING_N", "WORD_REPEAT_RULE", "MORFOLOGIK_RULE_EL_GR", "DOUBLE_PUNCTUATION") + ); + runTests(lang, "el", "ισότπς"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/IcelandicTest.java b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/IcelandicTest.java new file mode 100644 index 000000000000..4cd3477f6273 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/IcelandicTest.java @@ -0,0 +1,35 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2013 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; + +import org.junit.Test; +import org.languagetool.Language; +import org.languagetool.LanguageSpecificTest; + +import java.io.IOException; + +public class IcelandicTest extends LanguageSpecificTest { + + @Test + public void testRules() throws IOException { + Language lang = new Icelandic(); + runTests(lang, "is"); + } + +} diff --git a/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/IrishTest.java b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/IrishTest.java new file mode 100644 index 000000000000..0886923a9001 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/IrishTest.java @@ -0,0 +1,43 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2019 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; + +import org.junit.Test; +import org.languagetool.JLanguageTool; +import org.languagetool.Language; +import org.languagetool.rules.RuleMatch; + +import java.io.IOException; +import java.util.List; + +import static org.junit.Assert.assertEquals; + +public class IrishTest { + + @Test + public void testRules() throws IOException { + Language lang = new Irish(); + JLanguageTool lt = new JLanguageTool(lang); + List matches = lt.check("Seo abairt bheag."); + assertEquals(0, matches.size()); + matches = lt.check("Tá dhá dheartháireacha agam."); + assertEquals(1, matches.size()); + } + +} diff --git a/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/ItalianTest.java b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/ItalianTest.java new file mode 100644 index 000000000000..4dd40c8ceb4f --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/ItalianTest.java @@ -0,0 +1,40 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2019 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; + +import org.junit.Test; +import org.languagetool.LanguageSpecificTest; +import org.languagetool.language.it.Italian; + +import java.io.IOException; +import java.util.Arrays; + +public class ItalianTest extends LanguageSpecificTest { + + @Test + public void testLanguage() throws IOException { + // NOTE: this text needs to be kept in sync with config.ts -> DEMO_TEXTS: + String s = "Inserite qui il vostro testo... Oppure controlate direttamente questo ed avrete un assaggio di quali errori possono essere identificati con LanguageTool."; + Italian lang = new Italian(); + testDemoText(lang, s, + Arrays.asList("MORFOLOGIK_RULE_IT_IT", "ST_03_001") + ); + runTests(lang, "it"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/JapaneselTest.java b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/JapaneselTest.java new file mode 100644 index 000000000000..b3e3d4701db6 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/JapaneselTest.java @@ -0,0 +1,37 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2005 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; + +import org.junit.Test; +import org.languagetool.JLanguageTool; + +import java.io.IOException; + +import static org.junit.Assert.assertEquals; + +public class JapaneselTest { + + @Test + public void testJapanese() throws IOException { + final JLanguageTool tool = new JLanguageTool(new Japanese()); + assertEquals(0, tool.check("エラーを含まないテスト文です。").size()); + assertEquals(1, tool.check("エラーお含むテスト文です。").size()); + } + +} diff --git a/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/KhmerTest.java b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/KhmerTest.java new file mode 100644 index 000000000000..f3ddfd462b39 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/KhmerTest.java @@ -0,0 +1,39 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2019 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; + +import org.junit.Test; +import org.languagetool.LanguageSpecificTest; + +import java.io.IOException; +import java.util.Arrays; + +public class KhmerTest extends LanguageSpecificTest { + + @Test + public void testLanguage() throws IOException { + // NOTE: this text needs to be kept in sync with config.ts -> DEMO_TEXTS: + String s = "ឃ្លា\u200Bនេះ\u200Bបង្ហាញ\u200Bពី\u200Bពី\u200Bកំហុស\u200Bវេយ្យាករណ៍ ដើម្បី\u200Bបញ្ជាក់\u200Bពី\u200Bប្រសិទ្ធភាព\u200Bរបស់\u200Bកម្មវិធី LanguageTool សំរាប់\u200Bភាសាខ្មែរ។"; + Khmer lang = new Khmer(); + testDemoText(lang, s, + Arrays.asList("KM_WORD_REPEAT_RULE", "HUNSPELL_RULE", "HUNSPELL_RULE", "HUNSPELL_RULE", "HUNSPELL_RULE", "HUNSPELL_RULE", "KM_SIMPLE_REPLACE") + ); + runTests(lang, "km"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/LithuanianTest.java b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/LithuanianTest.java new file mode 100644 index 000000000000..219b22b399e9 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/LithuanianTest.java @@ -0,0 +1,35 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2013 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; + +import org.junit.Test; +import org.languagetool.Language; +import org.languagetool.LanguageSpecificTest; + +import java.io.IOException; + +public class LithuanianTest extends LanguageSpecificTest { + + @Test + public void testRules() throws IOException { + Language lang = new Lithuanian(); + runTests(lang, "lt"); + } + +} diff --git a/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/MalayalamTest.java b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/MalayalamTest.java new file mode 100644 index 000000000000..16ef41a38c1e --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/MalayalamTest.java @@ -0,0 +1,35 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2013 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; + +import org.junit.Test; +import org.languagetool.Language; +import org.languagetool.LanguageSpecificTest; + +import java.io.IOException; + +public class MalayalamTest extends LanguageSpecificTest { + + @Test + public void testRules() throws IOException { + Language lang = new Malayalam(); + runTests(lang, "ml"); + } + +} diff --git a/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/PersianTest.java b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/PersianTest.java new file mode 100644 index 000000000000..8a901f8a738d --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/PersianTest.java @@ -0,0 +1,39 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2019 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; + +import org.junit.Test; +import org.languagetool.LanguageSpecificTest; + +import java.io.IOException; + +public class PersianTest extends LanguageSpecificTest { + + @Test + public void testLanguage() throws IOException { + // NOTE: this text needs to be kept in sync with config.ts -> DEMO_TEXTS: + // commented out, as some rules seem to cause many (false?) alarms: + //String s = "لطفا متن خود را اینجا قرار دهید . یا بررسی کنید که این متن را\u200C برای دیدن بعضی بعضی از اشکال هایی که ابزار زبان توانسته تشخیس هدد. درباره ی نرم افزارهای بررسی کننده های گرامر چه فکر می کنید؟ لطفا در نظر داشته باشید که آن\u200Cها بی نقص نمی باشند.\u200E"; + Persian lang = new Persian(); + //testDemoText(lang, s, + // Arrays.asList("PERSIAN_COMMA_PARENTHESIS_WHITESPACE", "Bad_ZWNJ", "PERSIAN_WORD_REPEAT_RULE", "PluralFix", "PluralFix", "Complex_Present_Verbs", "Complex_Present_Verbs") + //); + runTests(lang, "fa", "ā"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/PolishTest.java b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/PolishTest.java new file mode 100644 index 000000000000..49b61d98a984 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/PolishTest.java @@ -0,0 +1,39 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2019 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; + +import org.junit.Test; +import org.languagetool.LanguageSpecificTest; + +import java.io.IOException; +import java.util.Arrays; + +public class PolishTest extends LanguageSpecificTest { + + @Test + public void testLanguage() throws IOException { + // NOTE: this text needs to be kept in sync with config.ts -> DEMO_TEXTS: + String s = "Wpisz tekst lub użyj istniejącego przykładu. To jest przykładowy tekst który pokazuje, jak jak działa LanguageTool. LanguageTool ma jusz korektor psowni, który wyrurznia bledy na czewrono."; + Polish lang = new Polish(); + testDemoText(lang, s, + Arrays.asList("BRAK_PRZECINKA_KTORY", "WORD_REPEAT_RULE", "PL_SIMPLE_REPLACE", "MORFOLOGIK_RULE_PL_PL", "MORFOLOGIK_RULE_PL_PL", "MORFOLOGIK_RULE_PL_PL", "MORFOLOGIK_RULE_PL_PL") + ); + runTests(lang, "pl", "ą"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/PortugueseTest.java b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/PortugueseTest.java new file mode 100644 index 000000000000..13e7f66e2fae --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/PortugueseTest.java @@ -0,0 +1,52 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2019 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; + +import org.junit.Test; +import org.languagetool.Language; +import org.languagetool.LanguageSpecificTest; + +import java.io.IOException; +import java.util.Arrays; + +public class PortugueseTest extends LanguageSpecificTest { + + @Test + public void testLanguage() throws IOException { + // NOTE: this text needs to be kept in sync with config.ts -> DEMO_TEXTS: + String s = "Cole aqui seu texto...ou verifique esta texto, afim de revelar alguns dos dos problemas que o LanguageTool consegue detectar. Isto tal vez permita corrigir os seus erro. Nós prometo ajudá-lo. para testar a grafia e as regrs do antigo) Acordo Ortográfico,, verifique o mesmo texto mesmo texto em Português de Angola ou Português do Moçambique e faça a analise dos resultados.. Nossa equipe anuncia a versão 4.5, que será lançada sexta-feira, 26 de março de 2019."; + PortugalPortuguese ptPT = new PortugalPortuguese(); + testDemoText(ptPT, s, + Arrays.asList("POSSESSIVE_WITHOUT_ARTICLE", "SPACE_AFTER_PUNCTUATION", "GENERAL_GENDER_AGREEMENT_ERRORS", "AFIM_DE", "PORTUGUESE_WORD_REPEAT_RULE", + "PT_AGREEMENT_REPLACE_DETECTAR", "TAL_VEZ", "GENERAL_NUMBER_AGREEMENT_ERRORS", "GENERAL_VERB_AGREEMENT_ERRORS", "UPPERCASE_SENTENCE_START", + "HUNSPELL_RULE", "UNPAIRED_BRACKETS", "DOUBLE_PUNCTUATION", "PHRASE_REPETITION", "GENTILICOS_LINGUAS", "GENTILICOS_LINGUAS", "ARTICLES_PRECEDING_LOCATIONS", //"REPEATED_WORDS", + "PARONYM_ANALISE_363", "DOUBLE_PUNCTUATION", "POSSESSIVE_WITHOUT_ARTICLE", "EQUIPES", "DATE_WEEKDAY") + ); + runTests(ptPT, "pt-PT", "õș"); + BrazilianPortuguese ptBR = new BrazilianPortuguese(); + String s2 = "Cole aqui seu texto...ou verifique esta texto, afim de revelar alguns dos dos problemas que o LanguageTool consegue detectar. Isto tal vez permita corrigir os seus erro. Nós prometo ajudá-lo. para testar a grafia e as regrs do antigo) Acordo Ortográfico,, verifique o mesmo texto mesmo texto em Português de Angola ou Português do Moçambique e faça a analise dos resultados.. Nossa equipe anuncia a versão 4.5, que será lançada sexta-feira, 26 de março de 2019."; + testDemoText(ptBR, s2, + Arrays.asList("SPACE_AFTER_PUNCTUATION", "GENERAL_GENDER_AGREEMENT_ERRORS", "AFIM_DE", "PORTUGUESE_WORD_REPEAT_RULE", "TAL_VEZ", + "GENERAL_NUMBER_AGREEMENT_ERRORS", "GENERAL_VERB_AGREEMENT_ERRORS", "UPPERCASE_SENTENCE_START", "HUNSPELL_RULE", + "UNPAIRED_BRACKETS", "DOUBLE_PUNCTUATION", "PHRASE_REPETITION", "GENTILICOS_LINGUAS", "GENTILICOS_LINGUAS", + "PARONYM_ANALISE_363", "DOUBLE_PUNCTUATION", "DATE_WEEKDAY") + ); + testReplaceRuleReplacements(ptBR); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/RomanianTest.java b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/RomanianTest.java new file mode 100644 index 000000000000..ea8abf269f7d --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/RomanianTest.java @@ -0,0 +1,32 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2019 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; + +import org.junit.Test; +import org.languagetool.LanguageSpecificTest; + +import java.io.IOException; + +public class RomanianTest extends LanguageSpecificTest { + + @Test + public void testLanguage() throws IOException { + runTests(new Romanian(), "ro"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/RussianTest.java b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/RussianTest.java new file mode 100644 index 000000000000..e1d5f98b8993 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/RussianTest.java @@ -0,0 +1,39 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2019 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; + +import org.junit.Test; +import org.languagetool.LanguageSpecificTest; + +import java.io.IOException; +import java.util.Arrays; + +public class RussianTest extends LanguageSpecificTest { + + @Test + public void testLanguage() throws IOException { + // NOTE: this text needs to be kept in sync with config.ts -> DEMO_TEXTS: + String s = "Вставьте ваш текст сюда .. или проверьте этот текстт. Релиз LanguageTool 4.7 состоялся в четверг 28 сентября 2019 года."; + Russian lang = new Russian(); + testDemoText(lang, s, + Arrays.asList( "DOUBLE_PUNCTUATION", "UPPERCASE_SENTENCE_START", "MORFOLOGIK_RULE_RU_RU", "DATE_WEEKDAY1") + ); + runTests(lang, "ru"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/SimpleGermanTest.java b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/SimpleGermanTest.java new file mode 100644 index 000000000000..fce57117f482 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/SimpleGermanTest.java @@ -0,0 +1,40 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2019 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; + +import org.junit.Test; +import org.languagetool.LanguageSpecificTest; + +import java.io.IOException; +import java.util.Arrays; + +public class SimpleGermanTest extends LanguageSpecificTest { + + @Test + public void testLanguage() throws IOException { + // NOTE: this text needs to be kept in sync with config.ts -> DEMO_TEXTS: + String s = "Fügen Sie hier Ihren Text ein oder benutzen Sie diesen Text als Beispiel. Dieser Text wurde nur zum Testen geschrieben. Die Donaudampfschifffahrt darf da nicht fehlen. Und die Nutzung des Genitivs auch nicht."; + SimpleGerman lang = new SimpleGerman(); + testDemoText(lang, s, + Arrays.asList("ZWEI_INFORMATIONSEINHEITEN_PRO_SATZ", /*"TOO_LONG_SENTENCE_DE", -- filtered due to overlapping other errors */ + "PASSIV", "LANGES_WORT", "VERNEINUNG", "ABSTRAKTE_WOERTER", "GENITIV") + ); + runTests(lang, "de-DE-x-simple-language"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/SlovakTest.java b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/SlovakTest.java new file mode 100644 index 000000000000..9f095dd2ae51 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/SlovakTest.java @@ -0,0 +1,35 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2019 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; + +import org.junit.Test; +import org.languagetool.LanguageSpecificTest; + +import java.io.IOException; + +public class SlovakTest extends LanguageSpecificTest { + + @Test + public void testLanguage() throws IOException { + // NOTE: this text needs to be kept in sync with config.ts -> DEMO_TEXTS: + //String s = "Toto je ukážkový vstup, na predvedenie funkčnosti LanguageTool. Pamätajte si si, že neobsahuje \"kontrolu\" preklepo."; -- commented out, as it's outdated + Slovak lang = new Slovak(); + runTests(lang, "sk"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/SlovenianTest.java b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/SlovenianTest.java new file mode 100644 index 000000000000..b0b616d2fd0a --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/SlovenianTest.java @@ -0,0 +1,39 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2019 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; + +import org.junit.Test; +import org.languagetool.LanguageSpecificTest; + +import java.io.IOException; +import java.util.Arrays; + +public class SlovenianTest extends LanguageSpecificTest { + + @Test + public void testLanguage() throws IOException { + // NOTE: this text needs to be kept in sync with config.ts -> DEMO_TEXTS: + String s = "Tukaj vnesite svoje besedilo... Pa poglejmo primer besedila s nekaj napakami ki jih lahko razpozna orodje LanguageTool; ko opazite napake, jih lahko enostavno popiravite. ( Obenem se izvrši tudi preverjanje črkovanja črkovanja."; + Slovenian lang = new Slovenian(); + testDemoText(lang, s, + Arrays.asList("TROPIČJETRI", "PREDLOG_S", "KI_BREZ_VEJICE", "MORFOLOGIK_RULE_SL_SI", "COMMA_PARENTHESIS_WHITESPACE", "WORD_REPEAT_RULE") + ); + runTests(lang, "sl"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/SpanishTest.java b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/SpanishTest.java new file mode 100644 index 000000000000..72ec4294d744 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/SpanishTest.java @@ -0,0 +1,51 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2019 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; + +import org.junit.Test; +import org.languagetool.LanguageSpecificTest; + +import java.io.IOException; +import java.util.Arrays; + +public class SpanishTest extends LanguageSpecificTest { + + @Test + public void testLanguage() throws IOException { + // NOTE: this text needs to be kept in sync with config.ts -> DEMO_TEXTS: + String s = "Escribe o pega tu texto aqui para tenerlo revisado contínuamente. los errores se subrayaran en diferentes colores: marcaremos los errores ortograficos en rojo; los errores de gramática son resaltado en amarillo; los problemas relacionados al estilo serán marcados en azul. Sabías que te proponemos sinónimos al hacer doble clic sobre una palabra? LanguageTool es un herramienta para textos impecables, sean e-mails, artículos, blogs o otros, incluso cuando el texto se complejice."; + Spanish lang = new Spanish(); + testDemoText(lang, s, + Arrays.asList("ES_SIMPLE_REPLACE_SIMPLE_AQUI", "MORFOLOGIK_RULE_ES", "UPPERCASE_SENTENCE_START", "SUBJUNTIVO_FUTURO", "MORFOLOGIK_RULE_ES", "AGREEMENT_VERB_PARTICIPLE", "RELACIONADO_A", "ES_QUESTION_MARK", "AGREEMENT_DET_NOUN", "Y_E_O_U", "COMPLEJIZAR") + ); + // , "ES_WIKIPEDIA_COMMON_ERRORS" + runTests(lang, "es", "ÍÚÑ"); + } + @Test + public void testLanguageVoseo() throws IOException { + // NOTE: this text needs to be kept in sync with config.ts -> DEMO_TEXTS: + String s = "Escribe o pega tu texto aqui para tenerlo revisado contínuamente. los errores se subrayaran en diferentes colores: marcaremos los errores ortograficos en rojo; los errores de gramática son resaltado en amarillo; los problemas relacionados al estilo serán marcados en azul. Sabías que te proponemos sinónimos al hacer doble clic sobre una palabra? LanguageTool es un herramienta para textos impecables, sean e-mails, artículos, blogs o otros, incluso cuando el texto se complejice."; + SpanishVoseo lang = new SpanishVoseo(); + testDemoText(lang, s, + Arrays.asList("ES_SIMPLE_REPLACE_SIMPLE_AQUI", "MORFOLOGIK_RULE_ES", "UPPERCASE_SENTENCE_START", "SUBJUNTIVO_FUTURO", "MORFOLOGIK_RULE_ES", "AGREEMENT_VERB_PARTICIPLE", "RELACIONADO_A", "ES_QUESTION_MARK", "AGREEMENT_DET_NOUN", "Y_E_O_U", "COMPLEJIZAR") + ); + // , "ES_WIKIPEDIA_COMMON_ERRORS" + runTests(lang, "es-AR", "ÍÚÑ"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/SwedishTest.java b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/SwedishTest.java new file mode 100644 index 000000000000..d4eaf5f69d6a --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/SwedishTest.java @@ -0,0 +1,33 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2019 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; + +import org.junit.Test; +import org.languagetool.LanguageSpecificTest; + +import java.io.IOException; + +public class SwedishTest extends LanguageSpecificTest { + + @Test + public void testLanguage() throws IOException { + runTests(new Swedish(), "sv"); + } + +} diff --git a/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/TagalogTest.java b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/TagalogTest.java new file mode 100644 index 000000000000..8c1d69102909 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/TagalogTest.java @@ -0,0 +1,39 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2019 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; + +import org.junit.Test; +import org.languagetool.LanguageSpecificTest; + +import java.io.IOException; +import java.util.Arrays; + +public class TagalogTest extends LanguageSpecificTest { + + @Test + public void testLanguage() throws IOException { + // NOTE: this text needs to be kept in sync with config.ts -> DEMO_TEXTS: + String s = "Ang LanguageTool ay maganda gamit sa araw-araw. Ang talatang ito ay nagpapakita ng ng kakayahan ng LanguageTool at hinahalimbawa kung paano ito gamitin. Litaw rin sa talatang ito na may mga bagaybagay na hindii pa kayang itama nng LanguageTool."; + Tagalog lang = new Tagalog(); + testDemoText(lang, s, + Arrays.asList("ADJECTIVE-V_COMMON_NOUN", "NG_NG", "MORFOLOGIK_RULE_TL", "R_WORDS", "MORFOLOGIK_RULE_TL", "MORFOLOGIK_RULE_TL", "MORFOLOGIK_RULE_TL") + ); + runTests(lang, "tl"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/TamilTest.java b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/TamilTest.java new file mode 100644 index 000000000000..4562d2906591 --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/TamilTest.java @@ -0,0 +1,39 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2019 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; + +import org.junit.Test; +import org.languagetool.LanguageSpecificTest; + +import java.io.IOException; +import java.util.Arrays; + +public class TamilTest extends LanguageSpecificTest { + + @Test + public void testLanguage() throws IOException { + // NOTE: this text needs to be kept in sync with config.ts -> DEMO_TEXTS: + String s = "இந்த பெட்டியில் உங்கள் உரையை ஒட்டி சரிவர சோதிக்கிறதா என பாருங்கள். 'லேங்குவேஜ் டூல்' சில இலக்கணப் பிழைகளைச் சரியாக கண்டுபிடிக்கும். பல பிழைகளைப் பிடிக்க தடுமாறலாம்."; + Tamil lang = new Tamil(); + testDemoText(lang, s, + Arrays.asList("Ends_in_A_1", "Ends_in_A_3", "Ends_in_A_3", "Ends_in_A_4", "Ends_in_A_2") + ); + runTests(lang, "ta"); + } +} diff --git a/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/UkrainianTest.java b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/UkrainianTest.java new file mode 100644 index 000000000000..ab9c1c4e131d --- /dev/null +++ b/languagetool-language-modules/language-java8compat/src/test/java/org/languagetool/language/UkrainianTest.java @@ -0,0 +1,43 @@ +/* LanguageTool, a natural language style checker + * Copyright (C) 2019 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; + +import org.junit.Test; +import org.languagetool.Language; +import org.languagetool.LanguageSpecificTest; + +import java.io.IOException; +import java.util.Arrays; + +public class UkrainianTest extends LanguageSpecificTest { + + @Test + public void testLanguage() throws IOException { + // NOTE: this text needs to be kept in sync with config.ts -> DEMO_TEXTS: + String s = "УВАГА! Внизу наведено приклад тексту з помилками, які допоможе виправити LanguageTool. Будь-ласка, вставте тутт ваш текст, або перевірте цей текст на предмет помилок. Знайти всі помилки для LanguageTool є не по силах з багатьох причин але дещо він вам все таки підкаже. Порівняно з засобами перевірки орфографії LanguageTool також змайде граматичні та стильові проблеми. LanguageTool — ваш самий кращий помічник."; + Language lang = new Ukrainian(); + testDemoText(lang, s, + Arrays.asList("UK_SIMPLE_REPLACE", "MORFOLOGIK_RULE_UK_UA", "NE_V_SYLAH", "comma_before_but", "WORDS_WITH_DASH", +// "PORIVNYANO_Z", + "MORFOLOGIK_RULE_UK_UA", "SAMYI_WITH_ADJ") + ); + runTests(lang, "uk"); + lang = new Ukrainian1992(); + } +} diff --git a/pom.xml b/pom.xml index b3264def9171..dd93b2dfe398 100644 --- a/pom.xml +++ b/pom.xml @@ -77,6 +77,7 @@ languagetool-http-client languagetool-tools languagetool-dev + languagetool-language-modules/language-java8compat