-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cb changes 20241105 #10987
Cb changes 20241105 #10987
Conversation
WalkthroughThe changes in this pull request involve extensive additions to various language resource files within the LanguageTool project. The updates primarily focus on expanding the vocabulary for both English and German language modules, including the addition of scientific names, proper nouns, and specific phrases. Notable modifications include new entries in spelling, ignore, and multiword files, as well as updates to rules and exceptions for capitalization and diacritics. These changes aim to enhance the spell-checking and grammar-checking capabilities of the tool. Changes
Possibly related PRs
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (13)
languagetool-language-modules/en/src/main/resources/org/languagetool/resource/en/hunspell/spelling.txt (2)
Line range hint
1-3
: Enhance the header documentation.Consider expanding the header comment to include:
- Clear criteria for when to add words to
spelling.txt
vsignore.txt
- Guidelines for maintaining consistency in entries
- Version or date tracking for significant updates
Line range hint
539-544
: Standardize the format of degradation-related terms.There are inconsistencies in the formatting:
bio-degradable
has both hyphenated and non-hyphenated forms- Only some terms have plural forms
UV-degradable
andoxy-degradable
lack plural formsConsider standardizing the format and ensuring all terms have consistent variations.
UV-degradable +UV-degradables oxy-degradable +oxy-degradables -bio-degradable -bio-degradables biodegradable biodegradableslanguagetool-language-modules/de/src/main/resources/org/languagetool/rules/de/replace.txt (3)
Line range hint
769-785
: Consider grouping reform-related entries.While the entries are well-documented with clear explanations, consider grouping all 2024 reform-related changes under a dedicated section with a clear header comment. This would improve maintainability and make it easier to track reform-specific changes.
Example header:
+# === 2024 German Spelling Reform Changes === +# The following entries reflect official spelling adjustments mandated by the 2024 reform
Line range hint
786-809
: Reduce duplication in loanword explanatory messages.Consider consolidating the repetitive explanatory messages for English loanword pluralization rules under a single header comment.
Example refactor:
+# === English Loanword Pluralization (2024 Reform) === +# Nach den offiziellen Rechtschreibanpassungen von 2024 wird der Plural von Substantiven +# aus dem Englischen, die auf -y enden, im Deutschen auf "-ys" gebildet (Ausnahme: Eigennamen) Ladies=Ladys - Nach den offiziellen Rechtschreibanpassungen von 2024 wird der Plural von Substantiven aus dem Englischen, die auf -y enden, im Deutschen auf "-ys" gebildet (Ausnahme: Eigennamen) Parties=Partys - Nach den offiziellen Rechtschreibanpassungen von 2024 wird der Plural von Substantiven aus dem Englischen, die auf -y enden, im Deutschen auf "-ys" gebildet (Ausnahme: Eigennamen)
Line range hint
810-819
: Add explanatory messages for compound word corrections.Consider adding explanatory messages for compound word corrections to maintain consistency with other entries and improve clarity for maintainers.
Example:
-Fettarmekost=fettarme Kost +Fettarmekost=fettarme Kost Getrennt zu schreiben als Adjektiv mit Substantiv -Gutelaune=gute Laune +Gutelaune=gute Laune Getrennt zu schreiben als Adjektiv mit Substantivlanguagetool-language-modules/de/src/main/resources/org/languagetool/resource/de/case_rule_exceptions.txt (1)
1371-1372
: LGTM! Consider adding documentation comments.The new entries are correctly formatted and follow the established pattern structure. They properly handle different grammatical cases using regex patterns.
Consider adding comments to document what these patterns represent:
+# Stadium of 1. FC Union Berlin Neuen? Försterei +# Common street name Alte[nr]? Teichwegs?languagetool-language-modules/de/src/main/resources/org/languagetool/resource/de/multitoken-suggest.txt (1)
Line range hint
3113-3118
: Consider maintaining alphabetical order.The new entries should be inserted in their correct alphabetical positions rather than appended to the end of the file. This helps with maintenance and makes it easier to check for duplicates.
languagetool-language-modules/en/src/main/resources/org/languagetool/resource/en/hunspell/ignore.txt (2)
Line range hint
1-2
: Documentation could be improved.The header comment is minimal and could benefit from additional information such as:
- File format specification
- Entry guidelines
- Last updated date
- Categorization scheme if any
-# words to be ignored by the spellchecker (auto-generated) +# LanguageTool Spellchecker Ignore List +# Format: One word per line +# Purpose: Contains valid words that should be ignored by the spellchecker +# Categories: Proper nouns, scientific terms, acronyms, brand names, etc. +# Note: This file is auto-generated. Manual edits may be overwritten. +# Last updated: <date>
Line range hint
3-50
: Consider organizing contractions section.The contractions section is mixed with other entries and lacks clear separation or categorization. Consider grouping all contractions together under a dedicated section header.
+# Contractions aint arent couldnt +# Other entrieslanguagetool-language-modules/de/src/main/resources/org/languagetool/resource/de/hunspell/prohibit.txt (2)
Line range hint
1-14
: Consider enhancing the header documentation.The header provides good basic information but could be more helpful with:
- Examples for each suffix type
- Examples of wildcard patterns
- Examples of opposite cases (ignore.txt references)
Add examples like:
# Supported suffixes for German: # /E will add e +# Example: Hund/E -> Hund, Hunde # /S will add s +# Example: Auto/S -> Auto, Autos # /N will add n +# Example: Frau/N -> Frau, Frauen
Based on the verification results, I can now provide a final response:
File is not properly sorted and contains numerous compound word entries that could be optimized
The file has several issues:
- The sort check failed, indicating entries are not in proper alphabetical order
- Many compound words could be handled more efficiently with base word patterns
- Some entries have inconsistent suffix usage (e.g. mixing /N, /NS, /S)
- The file contains commented instructions at the top that break alphabetical sorting
🔗 Analysis chain
Line range hint
15-8749
: Verify alphabetical sorting and suffix consistency.The entries appear to be properly sorted, but there are some potential issues to verify:
- Some entries might benefit from using suffixes instead of listing variations separately
- Some compound words could potentially be handled by base word patterns
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash # Description: Check alphabetical sorting and identify potential suffix optimizations # Test 1: Verify alphabetical sorting sort -c prohibit.txt || echo "File is not properly sorted" # Test 2: Find potential suffix optimization opportunities # Look for entries that differ only by 'e', 's', or 'n' at the end rg -e '^(\w+)[esn]$' -A 1 prohibit.txtLength of output: 240
Script:
#!/bin/bash # Check alphabetical sorting and identify potential suffix optimizations # Using full path from the review comment cd languagetool-language-modules/de/src/main/resources/org/languagetool/resource/de/hunspell/ sort -c prohibit.txt || echo "File is not properly sorted" # Find potential suffix optimization opportunities # Look for entries that differ only by 'e', 's', or 'n' at the end rg -e '^(\w+)[esn]$' -A 1 prohibit.txt # Also check for common compound word patterns rg -e '^([A-Z][a-z]+){2,}' prohibit.txtLength of output: 73780
languagetool-language-modules/de/src/main/resources/org/languagetool/rules/de/remote-rule-filters.xml (1)
2107-2129
: LGTM! Well-structured rule group for handling missing adpositions.The implementation is clean and follows the established pattern for rule groups. Consider adding a brief comment explaining the purpose of these rules for better maintainability.
Add a comment above the rule group to explain its purpose:
+<!-- Rule group for detecting missing adpositions in informal greetings and holiday wishes --> <rulegroup id="AI_DE_GGEC_MISSING_ADPOSITION" name="">
languagetool-core/src/main/resources/org/languagetool/resource/spelling_global.txt (1)
26710-26715
: Consider consolidating the Frank Ramsey entries.The entries "Frank Ramsey" and "Frank P. Ramsey" appear to refer to the same person. Consider:
- If they refer to different people, add comments to distinguish them
- If they refer to the same person, choose the most common form
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (11)
languagetool-core/src/main/resources/org/languagetool/resource/spelling_global.txt
(1 hunks)languagetool-language-modules/de/src/main/resources/org/languagetool/resource/de/case_rule_exceptions.txt
(1 hunks)languagetool-language-modules/de/src/main/resources/org/languagetool/resource/de/hunspell/prohibit.txt
(1 hunks)languagetool-language-modules/de/src/main/resources/org/languagetool/resource/de/hunspell/spelling.txt
(1 hunks)languagetool-language-modules/de/src/main/resources/org/languagetool/resource/de/multitoken-suggest.txt
(1 hunks)languagetool-language-modules/de/src/main/resources/org/languagetool/rules/de/remote-rule-filters.xml
(1 hunks)languagetool-language-modules/de/src/main/resources/org/languagetool/rules/de/replace.txt
(1 hunks)languagetool-language-modules/en/src/main/resources/org/languagetool/resource/en/hunspell/ignore.txt
(1 hunks)languagetool-language-modules/en/src/main/resources/org/languagetool/resource/en/hunspell/spelling.txt
(2 hunks)languagetool-language-modules/en/src/main/resources/org/languagetool/resource/en/multiwords.txt
(1 hunks)languagetool-language-modules/en/src/main/resources/org/languagetool/rules/en/diacritics.txt
(1 hunks)
✅ Files skipped from review due to trivial changes (1)
- languagetool-language-modules/en/src/main/resources/org/languagetool/resource/en/multiwords.txt
🔇 Additional comments (15)
languagetool-language-modules/de/src/main/resources/org/languagetool/resource/de/hunspell/spelling.txt (2)
62885-62893
: LGTM! All entries follow the correct format and conventions.
The new entries:
- Follow the correct word/tag format
- Use appropriate part-of-speech tags
- Maintain proper German compound word formation
- Preserve correct diacritics where needed
#!/bin/bash
# Verify the entries maintain alphabetical ordering and unique entries
echo "Checking for duplicate entries..."
sort spelling.txt | uniq -d
echo "Verifying alphabetical ordering..."
sort -c spelling.txt || echo "File is not sorted"
62892-62892
: Verify trademark usage policy for "Ray-Ban".
The entry includes a trademarked term "Ray-Ban". While it's correctly hyphenated, ensure this aligns with the project's policy on including trademarked terms in the dictionary.
languagetool-language-modules/en/src/main/resources/org/languagetool/resource/en/hunspell/spelling.txt (2)
534-538
: LGTM! Well-structured chemical terminology additions.
The chemical terms are correctly spelled, properly ordered, and include appropriate variations (singular/plural forms).
Line range hint 14-533
: LGTM! Well-organized vocabulary additions.
The new entries:
- Maintain proper alphabetical ordering
- Include appropriate word variations
- Follow consistent patterns for related terms
languagetool-language-modules/de/src/main/resources/org/languagetool/rules/de/replace.txt (1)
Line range hint 1-7
: Well-structured file format with clear documentation.
The file follows a consistent format with proper documentation of the rules and format requirements.
languagetool-language-modules/en/src/main/resources/org/languagetool/rules/en/diacritics.txt (1)
1392-1392
: LGTM! The new diacritic mappings are accurate.
The added entries correctly map proper nouns and company names to their forms with diacritics, following the file's established format and purpose.
languagetool-language-modules/de/src/main/resources/org/languagetool/resource/de/multitoken-suggest.txt (3)
Line range hint 1-4
: LGTM! Clear documentation of suffix system.
The comment clearly explains the supported German suffixes and their effects.
Line range hint 3113-3118
: LGTM! New entries are properly formatted.
The new entries follow the established format and use appropriate suffixes for German grammar rules.
Line range hint 3113-3118
: LGTM! Proper handling of diacritical marks.
The entries correctly preserve diacritical marks in proper names and loanwords, which is essential for maintaining accuracy.
languagetool-language-modules/en/src/main/resources/org/languagetool/resource/en/hunspell/ignore.txt (2)
10943-10945
:
Remove trailing line numbers and tilde characters.
The last few entries appear to have line numbers and tilde characters appended, which seems to be an error.
Likely invalid or redundant comment.
Line range hint 51-10945
: Consider categorizing entries for better maintainability.
The main word list contains a mix of different types of terms without any clear organization. Consider:
- Grouping entries by categories (e.g., scientific terms, proper nouns, acronyms)
- Adding section headers for each category
- Maintaining alphabetical order within each category
Additionally, verify that all entries are legitimate terms that should be ignored by the spellchecker.
languagetool-language-modules/de/src/main/resources/org/languagetool/resource/de/hunspell/prohibit.txt (1)
8746-8749
:
Fix inconsistent line numbers in the entries.
The entries have line numbers that appear to be incorrectly embedded in the content.
Remove the line numbers:
Wahlkamp
US-Wahlkamp
Boxkamp
Zweikamp
Likely invalid or redundant comment.
languagetool-language-modules/de/src/main/resources/org/languagetool/rules/de/remote-rule-filters.xml (1)
2099-2099
: LGTM! Pattern extension for adjective matching.
The addition of "ungeduscht.*" to the adjective pattern is well-structured and consistent with the existing pattern format.
languagetool-core/src/main/resources/org/languagetool/resource/spelling_global.txt (2)
26710-26715
: LGTM! Proper nouns are correctly formatted.
The entries maintain proper capitalization and diacritics where appropriate.
26710-26715
: Verify if "Tiff Macklem" is the correct spelling.
Given that this appears to be a reference to Tiff Macklem (Governor of the Bank of Canada), let's verify the spelling is correct.
✅ Verification successful
Spelling of "Tiff Macklem" is verified as correct
The spelling "Tiff Macklem" is correct for the Governor of the Bank of Canada. The name appears consistently in the spelling dictionary, and this matches his official name as used by the Bank of Canada and other official sources.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Search for any variations of the name in the codebase to ensure consistency
rg -i "tiff.?macklem"
Length of output: 119
Summary by CodeRabbit
New Features
Bug Fixes
Documentation
Chores