mike-fabian / ibus-typing-booster

ibus-typing-booster is a completion input method for faster typing
https://mike-fabian.github.io/ibus-typing-booster/
Other
232 stars 16 forks source link

[BUG] DICPATH not used #357

Closed dlip closed 2 years ago

dlip commented 2 years ago

Describe the bug

DICPATH is an environment variable used by hunspell when the user wants to customize the path to the dictionaries.

To Reproduce

Set DICPATH to a non standard path

Expected behavior

Dictionary should be found in DICPATH

mike-fabian commented 2 years ago

Do you think this commit is OK?

I ask because even if DICPATH is set, I keep datadir and user_datadir with higher priority than the directories specified by the DICPATH environment variable mostly because of the Finnish dictionary which ships with ibus-typing-booster and is usually installed at

/usr/share/ibus-typing-booster/data/fi_FI.dic

Finnish spellchecking uses Voikko and not hunspell, therefore usually no Finnish Hunspell exists. Voikko does not come with a Finnish dictionary in an easily parsable text format. Without a Finnish dictionary, Typing Booster could only do spellchecking of Finnish words using Voikko but not complete partially typed words. Therefore I added an old Finnish dictionary in Hunspell format to ibus-typing-booster to have at least some word completion for Finnish.

But that does not necessarily mean that DICPATH should not have higher priority. If no Finnish dictionary is found in DICPATH, it would still be found in datadir even if that has lower priority.

But it might be a bit surprising if a user has some special dictionaries in ~/.local/share/ibus-typing-booster/data/ and DICPATH is set because of some “accident” and his personal dictionaries are ignored.

At the moment I think keeping both datadir and user_datadir with higher priority than DICPATH is OK because the Finnish dictionaries is a very special case and unlikely to conflict with anything and very few user will even know that they can put dictionaries into ~/.local/share/ibus-typing-booster/data/, so there will rarely be a conflict.

It might be userful to keep ~/.local/share/ibus-typing-booster/data/ at high priority for personal stuff and use DICPATH more for global stuff.

mike-fabian commented 2 years ago

Include in: https://github.com/mike-fabian/ibus-typing-booster/releases/tag/2.18.7