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

Update not to use new English() style constructor #19

Conversation

miurahr
Copy link
Contributor

@miurahr miurahr commented Sep 30, 2023

Motivation

A pull-request to support JPMS will change package paths.
A dev document should help developers to be able to migrate smoothly.

Changes

  • Recommend getLanguageBy* method When LanguageTool supports Java Platform Module System introduced in Java 9, all the language classes should be changed its package path. In order to help users migration smoother, dev document recommends to use Languages.getLanguageBy* utility methods to create Language object in java-api.md.
  • Explain split package problem in code-style.md
  • Spell of GitHub trademark

- Recommend `getLanguageBy*` method
  When LanguageTool supports Java Platform Module System introduced in Java 9, all the language classes should be changed its package path.
  In order to help users migration smoother, dev document recommends to use Languages.getLanguageBy* utility methods to create Language object in java-api.md.
 - Explain split package problem in code-style.md
 - Spell of GitHub trademark

Signed-off-by: Hiroshi Miura <miurahr@linux.com>
java-api.md Outdated
@@ -52,7 +52,7 @@ that accepts the `AnnotatedText` object.
## Multi-Threading

The `JLanguageTool` class is not thread safe. Create one instance of `JLanguageTool`
per thread, but create the language only once (e.g. `new BritishEnglish()`) and
per thread, but create the language only once (e.g. `Languages.getLanguageByName("English (GB)")`) and
Copy link
Member

Choose a reason for hiding this comment

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

Could you suggest using getLanguageForShortCode("en-GB") here instead? Using the code seems more robust than using the name. (Same for the other occurrences of getLanguageForName)

Copy link
Contributor Author

@miurahr miurahr Oct 3, 2023

Choose a reason for hiding this comment

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

Thank you for the suggestion. Because I don't know a preference of "getlanguageFor*" methods, it is welcome to change.

- Use `getlanguageForShortCode` for alternative.
@danielnaber danielnaber merged commit 35e1df5 into languagetool-org:master Oct 3, 2023
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.

2 participants