From 32c3d588cafa24e6eb12fe951cf284f869f904f8 Mon Sep 17 00:00:00 2001 From: Christopher Blum Date: Fri, 12 Apr 2024 20:34:32 +0200 Subject: [PATCH] [en] improve rules --- .../rules/en/AbstractEnglishSpellerRule.java | 2 + .../resource/en/hunspell/ignore.txt | 2 + .../resource/en/hunspell/spelling.txt | 4 ++ .../languagetool/resource/en/multiwords.txt | 3 +- .../org/languagetool/rules/en/grammar.xml | 37 ++++++++++++++++++- 5 files changed, 46 insertions(+), 2 deletions(-) diff --git a/languagetool-language-modules/en/src/main/java/org/languagetool/rules/en/AbstractEnglishSpellerRule.java b/languagetool-language-modules/en/src/main/java/org/languagetool/rules/en/AbstractEnglishSpellerRule.java index 3acd8457adbf..c447285b0b1f 100644 --- a/languagetool-language-modules/en/src/main/java/org/languagetool/rules/en/AbstractEnglishSpellerRule.java +++ b/languagetool-language-modules/en/src/main/java/org/languagetool/rules/en/AbstractEnglishSpellerRule.java @@ -189,6 +189,7 @@ public List getAdditionalSpellingFileNames() { private static final Pattern GITLAB = compile("[Gg]itlab"); private static final Pattern BONAFIDE = compile("[Bb]onafide"); private static final Pattern WHEREEVER = compile("[Ww]hereever"); + private static final Pattern WHATSAPP = compile("[Ww]hatsapp"); private static final Pattern HUBSPOT = compile("[Hh]ubspot"); private static final Pattern URL = compile("[Uu]rl"); private static final Pattern TV = compile("tv"); @@ -1519,6 +1520,7 @@ protected List getOnlySuggestions(String word) { if (BONAFIDE.matcher(word).matches()) return topMatch(word.replaceFirst("onafide", "ona fide")); if (ALLRIGHT.matcher(word).matches()) return topMatch(word.replaceFirst("llright", "lright")); if (WHEREEVER.matcher(word).matches()) return topMatch(word.replaceFirst("hereever", "herever")); + if (WHATSAPP.matcher(word).matches()) return topMatch("WhatsApp"); if (TV.matcher(word).matches()) { List l = new ArrayList<>(); l.add(new SuggestedReplacement("TV")); diff --git a/languagetool-language-modules/en/src/main/resources/org/languagetool/resource/en/hunspell/ignore.txt b/languagetool-language-modules/en/src/main/resources/org/languagetool/resource/en/hunspell/ignore.txt index 9c471ac5a000..05c9fa8b6e33 100644 --- a/languagetool-language-modules/en/src/main/resources/org/languagetool/resource/en/hunspell/ignore.txt +++ b/languagetool-language-modules/en/src/main/resources/org/languagetool/resource/en/hunspell/ignore.txt @@ -10360,5 +10360,7 @@ add-ins MRs Gboard Clintonville +Cityhopper +hells RFP RFPs \ No newline at end of file diff --git a/languagetool-language-modules/en/src/main/resources/org/languagetool/resource/en/hunspell/spelling.txt b/languagetool-language-modules/en/src/main/resources/org/languagetool/resource/en/hunspell/spelling.txt index dc4ab3628537..7b885541de18 100644 --- a/languagetool-language-modules/en/src/main/resources/org/languagetool/resource/en/hunspell/spelling.txt +++ b/languagetool-language-modules/en/src/main/resources/org/languagetool/resource/en/hunspell/spelling.txt @@ -256,6 +256,10 @@ picolinate picolinates pospolite pospolites +neuroeconomic +neuroeconomics +sanitorium +sanitoriums e-visa e-visas matryoshka diff --git a/languagetool-language-modules/en/src/main/resources/org/languagetool/resource/en/multiwords.txt b/languagetool-language-modules/en/src/main/resources/org/languagetool/resource/en/multiwords.txt index 6962e2679ffa..d136af5e8030 100644 --- a/languagetool-language-modules/en/src/main/resources/org/languagetool/resource/en/multiwords.txt +++ b/languagetool-language-modules/en/src/main/resources/org/languagetool/resource/en/multiwords.txt @@ -7946,4 +7946,5 @@ Académie des Sciences Morales et Politiques NNP Académie des Beaux-Arts NNP Académie des Inscriptions et Belles Lettres NNP Académie Française NNP -Pinot noir _multiword_ \ No newline at end of file +Pinot noir _multiword_ +Folie à deux _multiword_ \ No newline at end of file diff --git a/languagetool-language-modules/en/src/main/resources/org/languagetool/rules/en/grammar.xml b/languagetool-language-modules/en/src/main/resources/org/languagetool/rules/en/grammar.xml index dd6da3470a0d..be7512b2098d 100644 --- a/languagetool-language-modules/en/src/main/resources/org/languagetool/rules/en/grammar.xml +++ b/languagetool-language-modules/en/src/main/resources/org/languagetool/rules/en/grammar.xml @@ -130583,6 +130583,36 @@ The accident victim died from her injuries. not + + by + accident|reason + + + the|a + will + by + + + be + please + by + + + little + by + little + + + by + years|months|weeks|days + end|start + + + by + year|month|week|day + 's + end|start + @@ -130743,7 +130773,12 @@ The accident victim died from her injuries. you|it - + pass + you|it + by + + + you|it