Skip to content
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

Merged
merged 4 commits into from
Nov 5, 2024
Merged

Cb changes 20241105 #10987

merged 4 commits into from
Nov 5, 2024

Conversation

tiff
Copy link
Member

@tiff tiff commented Nov 5, 2024

Summary by CodeRabbit

  • New Features

    • Expanded vocabulary with numerous scientific names and proper nouns across various fields.
    • Enhanced spell-checking capabilities for German and English with new entries in multiple files.
    • New rule group for handling specific phrases in German greetings and holiday wishes.
  • Bug Fixes

    • Corrections made to spelling and capitalization of names and terms in the German language module.
  • Documentation

    • Updated entries in the ignore list to improve spell-checker performance.
  • Chores

    • Cleaned up diacritical entries for proper nouns to enhance accuracy.

Copy link
Contributor

coderabbitai bot commented Nov 5, 2024

Walkthrough

The 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

File Path Change Summary
languagetool-core/src/main/resources/org/languagetool/resource/spelling_global.txt Added numerous scientific names and proper nouns, expanding vocabulary in biology, geography, and culture.
languagetool-language-modules/de/src/main/resources/org/languagetool/resource/de/case_rule_exceptions.txt Added new entries for capitalization exceptions: "Neuen? Försterei" and "Alte[nr]? Teichwegs?".
languagetool-language-modules/de/src/main/resources/org/languagetool/resource/de/hunspell/prohibit.txt Added various nouns, adjectives, and compound words as spelling errors to improve spell-checking for German.
languagetool-language-modules/de/src/main/resources/org/languagetool/resource/de/hunspell/spelling.txt Introduced new terms with part-of-speech tags, enhancing vocabulary for German spell-checking.
languagetool-language-modules/de/src/main/resources/org/languagetool/resource/de/multitoken-suggest.txt Added new proper nouns and phrases for multi-token suggestions in German.
languagetool-language-modules/de/src/main/resources/org/languagetool/rules/de/remote-rule-filters.xml Introduced new rule groups and updated existing rules for handling informal greetings and holiday wishes.
languagetool-language-modules/de/src/main/resources/org/languagetool/rules/de/replace.txt Updated numerous entries for spelling corrections, including adjustments based on the 2024 German spelling reform.
languagetool-language-modules/en/src/main/resources/org/languagetool/resource/en/hunspell/ignore.txt Added many entries to the ignore list for the English spell checker, expanding the scope of ignored terms.
languagetool-language-modules/en/src/main/resources/org/languagetool/resource/en/hunspell/spelling.txt Added various new words and phrases to enhance the English spell-checking capabilities.
languagetool-language-modules/en/src/main/resources/org/languagetool/resource/en/multiwords.txt Added new multi-word terms and updated existing entries for proper nouns in English.
languagetool-language-modules/en/src/main/resources/org/languagetool/rules/en/diacritics.txt Added and updated entries for diacritics in proper nouns to improve spelling accuracy.

Possibly related PRs

  • Cb changes 20240830 #10856: This PR adds new entries to the spelling_global.txt file, similar to the main PR's focus on expanding vocabulary with proper nouns and names.
  • Cb changes 20240905 #10865: This PR also modifies spelling_global.txt by adding new entries, which aligns with the main PR's goal of expanding the vocabulary.
  • [de] add words + gGEC AP + removed currencies #10961: This PR adds new entries to the ignore.txt file, which includes proper nouns, enhancing the language tool's vocabulary recognition, similar to the main PR's focus.
  • Cb changes 20241030 #10974: This PR adds a large number of proper nouns to spelling_global.txt, directly related to the main PR's changes in expanding vocabulary.

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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a 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 vs ignore.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 and oxy-degradable lack plural forms

Consider standardizing the format and ensuring all terms have consistent variations.

 UV-degradable
+UV-degradables
 oxy-degradable
+oxy-degradables
-bio-degradable
-bio-degradables
 biodegradable
 biodegradables
languagetool-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 Substantiv
languagetool-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 entries
languagetool-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:

  1. The sort check failed, indicating entries are not in proper alphabetical order
  2. Many compound words could be handled more efficiently with base word patterns
  3. Some entries have inconsistent suffix usage (e.g. mixing /N, /NS, /S)
  4. 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:

  1. Some entries might benefit from using suffixes instead of listing variations separately
  2. 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.txt

Length 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.txt

Length 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:

  1. If they refer to different people, add comments to distinguish them
  2. If they refer to the same person, choose the most common form
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between b17957e and a909d47.

📒 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: ⚠️ Potential issue

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:

  1. Grouping entries by categories (e.g., scientific terms, proper nouns, acronyms)
  2. Adding section headers for each category
  3. 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: ⚠️ Potential issue

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

@tiff tiff merged commit c0b1015 into master Nov 5, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant