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

feat: dictionary as language module #1185

Merged

Conversation

miurahr
Copy link
Member

@miurahr miurahr commented Nov 10, 2024

LanguageTool bundles hunspell or morfologik dictionary in language libraries.
This add new API to access these dictionary from spellchecker module.

Pull request type

  • Feature enhancement -> [enhancement]

Which ticket is resolved?

What does this PR change?

  • Add o.o.c.spellchecker.ISpellCheckerDictionary interface
  • Add o.o.c.s.AbstractMorfologikDictionary and o.o.c.s.AbstractHunspellDictionary classes
  • Add dictionary classes in language modules
  • Add tests for these dictionaries
  • Add developer manual how to create spell-check dictionary plugin.
  • Update user manual.
  • Update spelling dictionary preference GUI to remove URL box and install/uninstall buttons
  • Remove spelling dictionary installation dialog
  • Extend spelling dictionary preference GUI to list languages from language modules

Other information

This feature depends on another PR, #1183

- Add API installHunspellDictionary(Path dictionaryDir)
- Support it on AR, DA and FR
- Provide bundled dictionary on FR

Signed-off-by: Hiroshi Miura <[email protected]>
@miurahr miurahr force-pushed the topic/miurahr/spell-checker/dictionary-as-language-module branch from a51e221 to 66799c8 Compare November 21, 2024 05:31

This comment was marked as outdated.

This comment was marked as outdated.

@miurahr miurahr added this to the 6.1.0 (Require Java 11) milestone Nov 21, 2024
@omegat-org omegat-org deleted a comment from github-actions bot Nov 21, 2024
@omegat-org omegat-org deleted a comment from github-actions bot Nov 21, 2024
@omegat-org omegat-org deleted a comment from github-actions bot Nov 21, 2024
@miurahr miurahr force-pushed the topic/miurahr/spell-checker/dictionary-as-language-module branch from 41b598e to 33ec2ec Compare November 22, 2024 13:56
@miurahr miurahr force-pushed the topic/miurahr/spell-checker/dictionary-as-language-module branch from d05df47 to 213cfed Compare November 23, 2024 02:18
@miurahr miurahr marked this pull request as ready for review November 23, 2024 02:18

This comment was marked as resolved.

@omegat-org omegat-org deleted a comment from github-actions bot Nov 23, 2024
@omegat-org omegat-org deleted a comment from github-actions bot Nov 23, 2024
@omegat-org omegat-org deleted a comment from github-actions bot Nov 23, 2024
@omegat-org omegat-org deleted a comment from github-actions bot Nov 23, 2024
@omegat-org omegat-org deleted a comment from github-actions bot Nov 23, 2024
@omegat-org omegat-org deleted a comment from github-actions bot Nov 23, 2024
@omegat-org omegat-org deleted a comment from github-actions bot Nov 23, 2024
@omegat-org omegat-org deleted a comment from github-actions bot Nov 23, 2024
@omegat-org omegat-org deleted a comment from github-actions bot Nov 23, 2024
@omegat-org omegat-org deleted a comment from github-actions bot Nov 23, 2024
@omegat-org omegat-org deleted a comment from github-actions bot Nov 23, 2024
@omegat-org omegat-org deleted a comment from github-actions bot Nov 23, 2024

This comment was marked as resolved.

This comment was marked as outdated.

This comment was marked as outdated.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

This comment was marked as resolved.

- explain the folder for user CUSTOM spelling dictionary
- explain the language module will install the spelling dictionary when necessary.
- update explaination of the spelling preference

Signed-off-by: Hiroshi Miura <[email protected]>
- Remove URL box and install/uninstall buttons
- Remove DictionaryInstallerDialog
- clean bundles

Signed-off-by: Hiroshi Miura <[email protected]>
- Extend SpellCheckerManager to return supported languages
- Update DictionaryManager#getLocalDictionaryCodeList to return languages from language modules

Signed-off-by: Hiroshi Miura <[email protected]>
Copy link
Member Author

@miurahr miurahr left a comment

Choose a reason for hiding this comment

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

Developer manual should be improved in section title levels, overview explanations.

@@ -0,0 +1,237 @@
# How to publish a spell check dictionary as plugin

#### Overview
Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
#### Overview
## Overview

Level of section title is wrong

This document provides guidance on creating a plugin, explaining the purpose of the interface methods,
and giving practical tips for implementation.

#### `ISpellCheckDictionary` Interface
Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
#### `ISpellCheckDictionary` Interface
## `ISpellCheckDictionary` Interface

}
```

#### Method Descriptions
Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
#### Method Descriptions
### Method Descriptions

}
```

#### Example Implementation
Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested change
#### Example Implementation
### Example Implementation

These plugins must implement the `ISpellCheckDictionary` interface, which defines the necessary methods
to integrate with OmegaT.

This document provides guidance on creating a plugin, explaining the purpose of the interface methods,
Copy link
Member Author

Choose a reason for hiding this comment

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

The overview section should also explain the abstract classes and how to register Spell checker dictionary provider into OmegaT core when loading the plugins.

…language-module

# Conflicts:
#	src/org/omegat/gui/dialogs/DictionaryInstallerDialog.java
@brandelune
Copy link
Contributor

Developer manual should be improved in section title levels, overview explanations.

@Kazephil Could you take a look please?

brandelune and others added 2 commits December 1, 2024 13:20
@Kazephil could you check my modifications please?
@miurahr I don’t think we should refer to the developer manual here. We have not done so for other parts of OmegaT. I don’t oppose that, of course, but we need to think about how to do that.
- I tried to reword the paragraph to flow more smoothly. Let me know if anything seems off.

- I agree with Jean-Christophe about the developer manual reference, so I simply deleted it here. We will have to give some thought about how and where we can best make that information available.
Copy link
Contributor

Choose a reason for hiding this comment

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

It looks like my rewording came through, but not my comments.

I tried to reword the paragraph to flow more smoothly, and I removed the line about the developer manual. On that last point, I agree with Jean-Christophe both that having it is a good idea, and that this isn't the place for it.

We'll have to give some thought to how and where to best present information that directs the reader to the developer manual.

Copy link
Member Author

Choose a reason for hiding this comment

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

We'll have to give some thought to how and where to best present information that directs the reader to the developer manual.

I think it is out of scope of the PR here, and lets discuss in dev-ML.

- fix section levels
- update overview section

Signed-off-by: Hiroshi Miura <[email protected]>
Copy link

github-actions bot commented Dec 3, 2024

❌ Acceptance Tests failed.

Please look a Gradle Scan page for details:
https://gradle.com/s/rbsqaczewdodg

@miurahr
Copy link
Member Author

miurahr commented Dec 4, 2024

Acceptance test is flaky. It does not depend on the issue.

@miurahr miurahr merged commit 4175085 into master Dec 5, 2024
12 of 13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants