Skip to content

Commit

Permalink
feat: Improve spell checker: use dict bundled in LT, drop jmyspell, a…
Browse files Browse the repository at this point in the history
…nd add morfologik (#1036)

* refactor: spell checker preferences in main module

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

* feat: hunspell and morfologik spellchecker modules

- Add morfologik spellcheck module
- Rename hunspell-jmyspell to hunspell module
- Drop jmyspell fallback
- ISpellChecker#initialize return boolean

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

* feat: core/spellcheck recognize morfologik dict

- Add SpellCheckDictionaryType
- OConsts: define morfologik dict file extension

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

* style: copyright header

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

* feat: add unit tests

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

* feat: hunspell: import LT bundled dic

LanguageTool bundles Hunspell dictionary in some languages such as de_DE, too. This revert a feature to import LT bundled dictionary when exists.

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

* fix: morfologik: cp dict and info from LT

Morfologik checker use both *.dict and *.info

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

* fix: relax expectation of hunspell unit test

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

* hunspell test case with LT bundled one

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

* feat: hunspell load LT bundled dictionary

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

---------

Signed-off-by: Hiroshi Miura <[email protected]>
  • Loading branch information
miurahr authored Jun 2, 2024
1 parent 8d32dc0 commit 20e43d1
Show file tree
Hide file tree
Showing 42 changed files with 65,773 additions and 880 deletions.
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ dependencies {
implementation(libs.omegat.htmlparser)
implementation(libs.omegat.gnudiff4j)
implementation(libs.omegat.mnemonics)
implementation(libs.omegat.jmyspell.core)

// LanguageTool
implementation(libs.languagetool.core) {
Expand Down
6 changes: 4 additions & 2 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,14 @@ dsl4j = "1.0.0"
stardict4j = "1.1.0"
juniversalchardet = "2.5.0"
mnemonics = "1.2"
jmyspell = "1.0.0-beta-2"
hunspell = "2.1.2"
xjc = "2.3.4"
jna = "5.13.0"
jfa = "1.2.0"
tipoftheday = "0.4.4"
flatlaf="3.4.1"
assertj_swing_junit = "4.0.0-beta-1"
morfologik = "2.1.9"

[libraries]
slf4j-api = {group = "org.slf4j", name = "slf4j-api", version.ref = "slf4j"}
Expand Down Expand Up @@ -128,7 +128,6 @@ dsl4j = {group = "tokyo.northside", name = "dsl4j", version.ref = "dsl4j"}
stardict4j = {group = "tokyo.northside", name = "stardict4j", version.ref = "stardict4j"}
juniversal-chardet = {group = "com.github.albfernandez", name = "juniversalchardet", version.ref = "juniversalchardet"}
omegat-mnemonics = {group = "org.omegat", name = "lib-mnemonics", version.ref = "mnemonics"}
omegat-jmyspell-core = {group = "org.omegat", name = "jmyspell-core", version.ref = "jmyspell"}
dumont-hunspell = {group = "com.gitlab.dumonts", name = "hunspell", version.ref = "hunspell"}
jaxb-xjc = {group = "org.grassfish.jaxb", name = "jaxb-xjc", version.ref = "xjc"}
tipoftheday = {group = "tokyo.northside", name = "tipoftheday", version.ref = "tipoftheday"}
Expand All @@ -137,6 +136,8 @@ jfa = {group = "de.jangassen", name = "jfa", version.ref = "jfa"}
flatlaf = {group = "com.formdev", name = "flatlaf", version.ref = "flatlaf"}
language-detector = {group = "org.omegat", name = "language-detector", version.ref = "languagedetector"}
assertj_swing_junit = {group = "tokyo.northside", name = "assertj-swing-junit", version.ref = "assertj_swing_junit"}
morfologik = { group = "org.carrot2", name = "morfologik-stemming", version.ref = "morfologik" }
morfologik-speller = { group = "org.carrot2", name = "morfologik-speller", version.ref = "morfologik" }

[bundles]
groovy = ["groovy-jsr223", "groovy-dateutil", "groovy-json", "groovy-xml", "groovy-swing", "groovy-templates", "ivy"]
Expand All @@ -150,6 +151,7 @@ lucene = ["lucene-core", "lucene-analyzers-common", "lucene-analyzers-kuromoji",
jgit = ["jgit", "jgit-agent", "jgit-http", "jgit-ssh"]
dictionary = ["trie4j", "dsl4j", "stardict4j", "jsoup"]
xmlunit = ["xmlunit-core", "xmlunit-assertj", "assertj"]
morfologik = ['morfologik', 'morfologik-speller']

[plugins]
spotbugs = {id = "com.github.spotbugs", version = "6.0.15"}
Expand Down
3 changes: 2 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@ include("machinetranslators:apertium",
"machinetranslators:dummy",
"aligner",
"theme",
"spellchecker:hunspell-jmyspell",
"spellchecker:hunspell",
"spellchecker:morfologik",
"tipoftheday")

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 20e43d1

Please sign in to comment.