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 20241106 #10998

Merged
merged 5 commits into from
Nov 7, 2024
Merged

Cb changes 20241106 #10998

merged 5 commits into from
Nov 7, 2024

Conversation

tiff
Copy link
Member

@tiff tiff commented Nov 7, 2024

Summary by CodeRabbit

Release Notes

  • New Features

    • Expanded vocabulary with numerous scientific names, proper nouns, and multi-word phrases for improved language processing.
    • Added specific rules for correct usage of "DIN A4" in German grammar checks.
  • Bug Fixes

    • Corrected spelling of various names and terms to align with the latest German spelling reform.
    • Enhanced handling of diacritics for proper nouns and common terms in English.
  • Documentation

    • Updated entries in the ignore and spelling lists to improve user experience by reducing false positives in spell checks.

Copy link
Contributor

coderabbitai bot commented Nov 7, 2024

Walkthrough

The changes in this pull request primarily involve the addition of a significant number of scientific names for various species, as well as proper nouns, including names of people, places, and products. These modifications aim to expand the vocabulary and knowledge base of the language model. Additionally, several files related to German and English language modules have been updated to include new terms, spelling corrections, and grammatical rules, enhancing the overall functionality of the language processing tool.

Changes

File Change Summary
languagetool-core/src/main/resources/org/languagetool/resource/spelling_global.txt Added numerous scientific names and proper nouns to expand vocabulary.
languagetool-language-modules/de/src/main/resources/org/languagetool/resource/de/hunspell/ignore.txt Added five new entries to the ignore list for specific names.
languagetool-language-modules/de/src/main/resources/org/languagetool/resource/de/hunspell/spelling.txt Introduced six new terms with an /A suffix for German spelling recognition.
languagetool-language-modules/de/src/main/resources/org/languagetool/resource/de/multitoken-ignore.txt Added a new multi-token entry lac Léman/S #name to the ignore list.
languagetool-language-modules/de/src/main/resources/org/languagetool/resource/de/multitoken-suggest.txt Added multiple new entries including proper nouns and phrases for suggestions.
languagetool-language-modules/de/src/main/resources/org/languagetool/rules/de/grammar.xml Introduced a new rule group for "DIN A4" with five rules related to its usage in German.
languagetool-language-modules/de/src/main/resources/org/languagetool/rules/de/replace.txt Updated replacement rules to align with the 2024 German spelling reform, correcting various terms.
languagetool-language-modules/en/src/main/resources/org/languagetool/resource/en/hunspell/spelling.txt Added numerous new entries to expand the English vocabulary, including scientific and cultural terms.
languagetool-language-modules/en/src/main/resources/org/languagetool/resource/en/multiwords.txt Extensive additions of new multi-word terms and updates to existing entries.
languagetool-language-modules/en/src/main/resources/org/languagetool/rules/en/diacritics.txt Updated entries to include diacritics for proper nouns and common terms, enhancing accuracy.

Possibly related PRs

  • Cb changes 20240830 #10856: This PR adds several proper nouns to spelling_global.txt, similar to the main PR's focus on expanding vocabulary with proper nouns and scientific names.
  • [pt] Removed "temp_off" from rule ID:OS_DOIS_AS_DUAS_AMBOS_AMBAS #10887: This PR also adds a large number of scientific names and proper nouns to spelling_global.txt, directly aligning with the main PR's objective of expanding the vocabulary and knowledge base.
  • Cb changes 20241030 #10974: This PR introduces numerous proper nouns and names related to various topics in spelling_global.txt, which is consistent with the main PR's aim to enhance the vocabulary.
  • Cb changes 20241105 #10987: This PR adds scientific names and proper nouns to spelling_global.txt, mirroring the main PR's focus on expanding the vocabulary and knowledge base.

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

🧹 Outside diff range and nitpick comments (7)
languagetool-language-modules/de/src/main/resources/org/languagetool/rules/de/grammar.xml (5)

17983-17983: Document the temporary state of this rule group.

The rule group is currently disabled by default (temp_off). Consider adding a comment explaining when this temporary state will be lifted and what conditions need to be met before enabling it by default.


17984-17992: Consider adding more test cases.

The rule implementation looks good with proper pattern matching and non-breaking space in the suggestion. Consider adding test cases for:

  • Lower case variations (e.g., "dina4")
  • Numbers other than 4 (e.g., "DinA3", "DinA5")

18001-18010: Standardize error message format.

The implementation looks good, but consider rephrasing the error message "Hier scheint ein oder zwei Bindestrich(e) zu fehlen" to be more specific about exactly how many hyphens are missing in each case, similar to the fourth rule's message.


18011-18020: Add negative test cases.

While the rule correctly handles the positive case, consider adding negative test cases (marked with <example>...</example> without correction) to ensure the rule doesn't trigger on valid constructs.


18021-18030: Make the error message more specific.

The current message "Bitte die Schreibweise dieses Nomens prüfen" is vague. Consider making it more specific about what aspect of the writing needs to be checked (e.g., "DIN sollte in Großbuchstaben geschrieben werden").

languagetool-language-modules/en/src/main/resources/org/languagetool/resource/en/hunspell/spelling.txt (1)

Standardize to "biodegradable" form without hyphenation

Based on the search results:

  • The non-hyphenated form "biodegradable" is used in Spanish (es) and Galician (gl) dictionaries
  • The English dictionary currently has both forms, which can lead to inconsistency
  • The compounds.txt file uses the hyphenated form with a question mark, suggesting it's a tentative entry

Recommend:

  • Remove "bio-degradable" and "bio-degradables"
  • Keep "biodegradable" and "biodegradables" as the standard forms
  • Update compounds.txt to remove or update the "bio-degradable?" entry

This aligns with the most common usage across languages and modern scientific writing.

🔗 Analysis chain

Line range hint 537-544: Consider standardizing hyphenation in related terms.

While both hyphenated and non-hyphenated forms are technically correct, consider standardizing the usage for consistency:

  • "bio-degradable"/"bio-degradables" vs "biodegradable"/"biodegradables"

Choose one style and apply it consistently across the codebase.

Let's check for consistency in other files:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other occurrences of these terms to ensure consistent hyphenation
rg -i "bio.?degradable" 

Length of output: 1419

languagetool-language-modules/en/src/main/resources/org/languagetool/rules/en/diacritics.txt (1)

Line range hint 1369-1427: Consider grouping related entries together.

While the additions are correct, consider organizing related entries together. For example:

  • Group entries by language origin (Spanish, Portuguese, Turkish, etc.)
  • Group entries by type (person names, place names, etc.)
    This would make future maintenance and updates easier.
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between b3176b4 and 00f2027.

📒 Files selected for processing (10)
  • languagetool-core/src/main/resources/org/languagetool/resource/spelling_global.txt (1 hunks)
  • languagetool-language-modules/de/src/main/resources/org/languagetool/resource/de/hunspell/ignore.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-ignore.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/grammar.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/spelling.txt (1 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 (3)
  • languagetool-language-modules/de/src/main/resources/org/languagetool/resource/de/hunspell/ignore.txt
  • languagetool-language-modules/de/src/main/resources/org/languagetool/resource/de/hunspell/spelling.txt
  • languagetool-language-modules/de/src/main/resources/org/languagetool/resource/de/multitoken-ignore.txt
🔇 Additional comments (14)
languagetool-language-modules/en/src/main/resources/org/languagetool/resource/en/hunspell/spelling.txt (1)

Line range hint 1-544: LGTM! The additions enhance the spell checker's vocabulary.

The new entries:

  • Follow the existing file structure
  • Include comprehensive word forms (singular/plural, different tenses)
  • Cover diverse fields (scientific, technical, cultural)
  • Maintain alphabetical ordering
languagetool-language-modules/de/src/main/resources/org/languagetool/rules/de/replace.txt (3)

770-772: LGTM: Proper noun and French term additions are correct.

The new entries correctly handle diacritical marks and follow proper formatting conventions.


Line range hint 773-870: LGTM: German spelling reform updates are comprehensive and well-documented.

The changes correctly implement the 2024 German spelling reform requirements:

  1. Standardization of food terms (e.g., Spaghetti, Thunfisch)
  2. Proper handling of French loanwords with diacritical marks
  3. Updated spelling of common nouns
  4. Consistent pluralization of English loanwords ending in -y to -ys

Each entry includes helpful explanatory messages that clarify the reasoning behind the changes.


Line range hint 871-882: LGTM: Compound word corrections are accurate.

The entries correctly handle:

  1. Separation of incorrectly joined adjective-noun combinations
  2. Proper capitalization rules
  3. Complete case variations for inflected forms
languagetool-language-modules/en/src/main/resources/org/languagetool/rules/en/diacritics.txt (2)

Line range hint 1-1368: LGTM! Well-structured resource file.

The file follows a consistent and clear format with proper documentation.


Line range hint 1369-1427: Verify consistency across language modules.

Since these diacritical corrections might be relevant for multiple languages, ensure that corresponding updates are made in related language modules where applicable.

languagetool-language-modules/de/src/main/resources/org/languagetool/resource/de/multitoken-suggest.txt (3)

3114-3117: LGTM! The entries are properly formatted and consistent.

The new entries follow the established pattern with correct suffix indicators and maintain consistency with existing entries.


Line range hint 3118-3128: LGTM! Entries are well-formatted and properly organized.

The new entries maintain consistency with:

  • Correct suffix indicators
  • Proper alphabetical ordering
  • Appropriate mix of proper nouns and terms

Line range hint 3129-3130: LGTM! Scientific name and proper name are correctly formatted.

The entries maintain proper formatting:

  • Scientific name follows binomial nomenclature without suffix
  • Proper name includes appropriate suffix indicator
languagetool-language-modules/en/src/main/resources/org/languagetool/resource/en/multiwords.txt (2)

Line range hint 1-4: LGTM! Clear and comprehensive file header documentation.

The header comments effectively explain:

  • Purpose of the file (English multiwords for disambiguation)
  • Usage criteria (single POS terms only)
  • Relationship with spelling.txt
  • Case sensitivity handling

Line range hint 1-6021: Verify consistency of POS tags for similar terms.

The file contains many cultural and religious terms. Let's verify consistent POS tagging across similar terms.

✅ Verification successful

POS tags are consistent for religious/cultural greetings and expressions

The verification shows that all similar religious/cultural greeting terms (salaam/assalamu/as-salamu alaikum and mazel/mazal tov) are consistently tagged as interjections (UH), which is appropriate for these expressions of greeting and blessing.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check POS tag consistency for similar terms
# Test: Search for religious/cultural terms and their POS tags
rg "^(mazal|mazel|shalom|amen|hallelujah|alleluia|salaam|assalamu|as-salamu).+\s(UH|NNP|NN)" multiwords.txt

Length of output: 164


Script:

#!/bin/bash
# Description: Check POS tag consistency for similar terms
# Test: Search for religious/cultural terms and their POS tags from the repository root
rg "^(mazal|mazel|shalom|amen|hallelujah|alleluia|salaam|assalamu|as-salamu).+\s(UH|NNP|NN)" -g "multiwords.txt"

Length of output: 677

languagetool-core/src/main/resources/org/languagetool/resource/spelling_global.txt (3)

26717-26717: Verify diaeresis usage in "Chloë".

The spelling "Chloë" correctly uses a diaeresis. This is consistent with the standard spelling of the actress's name.


26713-26714: Consider consolidating name variants.

The file contains two variants of the same name: "Gideon Saar" and "Gideon Sa'ar". Consider documenting which is the preferred spelling or if both variants should be maintained.

Let's check for any existing documentation or patterns:

#!/bin/bash
# Description: Look for documentation about handling name variants
# Expected: Guidelines or similar patterns in other names

rg -l "name.*variant" --type md

26712-26718: Investigate inconsistent line numbering.

Some entries have line numbers (26712-26718) while others don't. This inconsistency might indicate a structural issue in the file.

Let's check the file structure:

Comment on lines +17993 to +18000
<rule>
<pattern>
<token regexp="yes">Dina[0-7]-(Format|Grö(ß|ss)e|Ma(ß|ss)e|Papier|Blatt|Druck|Poster|Rahmen|Plakat|Kalender|Werbe|Block|Bild|Brief|Zettel|Bogen).*</token>
</pattern>
<message>Diese Papiergröße wird in der Regel mit Bindestrichen geschrieben.</message>
<suggestion><match no="1" regexp_match="(?i)Dina" regexp_replace="DIN-A" /></suggestion>
<example correction="DIN-A4-Blatt">Ich schreibe auf ein <marker>DINA4-Blatt</marker>.</example>
</rule>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛠️ Refactor suggestion

Optimize pattern and enhance test coverage.

  1. Consider extracting the repeated noun list (Format|Grö(ß|ss)e|...) into a shared variable or entity to improve maintainability, as it's used in multiple rules.
  2. Add more examples covering:
    • Different suffixes from the pattern
    • Various number combinations (A3, A5, etc.)

@tiff tiff merged commit ae6008b into master Nov 7, 2024
5 checks passed
@tiff tiff deleted the cb-changes-20241106 branch November 7, 2024 14:02
@coderabbitai coderabbitai bot mentioned this pull request Nov 11, 2024
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