Open xsmile opened 7 years ago
How feasible is it to modify the Chromium code to use system hunspell libraries?
I think it might be easier to write an external script that downloads the requested dictionary. This file describes how to convert the dictionaries using a script not available in the Chromium repo, and they in fact are using Hunspell, just with a custom dictionary format. Here's their Hunspell fork with google.patch
(that alone being almost 1K of new code, modifying a few Hunspell components) and google/bdict*
being the format reader/writer. Not sure if anyone really wants to patch and maintain that.
@DragoonAethis The page you linked says the hunspell code has moved here. According to README.chromium, it seems that most of the modifications are optimizations or slight usability enhancements. I just dug through some Chromium code and Hunspell doesn't seem too tightly integrated, so I'll consider writing a patch at some point in the future.
What's the status of this issue?
I can't speak for gcarq, but I haven't done anything related to this yet. I haven't been working on anything Chromium-related recently.
There is also no status update from my side
I've looked into this more, and it'll take more work than I originally thought. There are two main files that need to be refactored:
chrome/browser/spellchecker/spellcheck_hunspell_dictionary.cc
- Needs refactoring to read Hunspell dictionaries from the system instead of downloading and reading BDict dictionaries. This includes converting a Chromium language string to a language code for Hunspell dictionaries (something similar to what's in components/spellcheck/common/spellcheck_common.cc
).components/spellcheck/renderer/hunspell_engine.cc
- Needs refactoring to use the system Hunspell interface instead of Google's Hunspell library //third_party/hunspell
. Google's Hunspell library can't be used since it's been changed to use BDict dictionaries.There are some other things as well, such as removing GN references to //third_party/hunspell
, dynamically linking the Hunspell library, and implementing detection of system Hunspell dictionaries.
I don't have time right now to figure all of this out, so hopefully someone else that's interested can take over.
Due to the disabled automatic download function of dictionaries, Inox is missing them and spell checking is not working.
System hunspell dictionaries cannot be used with chromium because it uses a custom file format. They can be converted though.
To manually install a dictionary offered by Google, get a language-spcecific *.bdic file from https://chromium.googlesource.com/chromium/deps/hunspell_dictionaries/+/master, place it in ~/.config/inox/Dictionaries and restart the browser.