cargo-spellcheck icon indicating copy to clipboard operation
cargo-spellcheck copied to clipboard

clarify docs of `Hunspell.extra_dictionaries`

Open lolbinarycat opened this issue 1 year ago • 4 comments

multiple things confuse me:

  • the documentation says that extra dictionaries are searched relative to the config file dir, but also relative to the search paths
  • it is not clear to me if extra dictionaries use the personal dictionary syntax or the full dictionary syntax

also, does search_dirs override DICPATH instead of prepending to it? is there any way to make it used in addition to the os paths?

i don't see an obvious way to just add a few new words.

lolbinarycat avatar Feb 15 '25 20:02 lolbinarycat

the documentation says that extra dictionaries are searched relative to the config file dir, but also relative to the search paths

They're not mutually exclusive. One is project specific (relative to config) and the other takes your system paths into account ( https://github.com/drahnr/cargo-spellcheck/blob/master/src/config/search_dirs.rs#L14-L17 )

it is not clear to me if extra dictionaries use the personal dictionary syntax or the full dictionary syntax

Full dictionary syntax.

does search_dirs override DICPATH instead of prepending to it? is there any way to make it used in addition to the os paths?

There is no implementation I am aware of accounting for DICPATH, if so, please point me to the particular code or library.

It be helpful if you could point to specific sections of documentation that's lacking clarity. Or even create a PR :)

drahnr avatar Feb 17 '25 09:02 drahnr

here is the documentation i am confused about

is the dictionary relative to Cargo.toml or the config.toml of cargo-spellcheck?

DICPATH is used in hunspell itself, although i'm not sure if it activates when used as a library, or only the executible.

lolbinarycat avatar Feb 19 '25 04:02 lolbinarycat

is the dictionary relative to Cargo.toml or the config.toml of cargo-spellcheck?

to config.toml, since a installed cargo-spellcheck instance does not have knowledge of the location of the Cargo.toml nor does it necessarily exist (cargo install cargo-spellcheck)

DICPATH is used in hunspell itself, although i'm not sure if it activates when used as a library, or only the executible

It's only used in the CLI tool from a quick look into hunspell source

drahnr avatar Feb 21 '25 15:02 drahnr

See #293 for others' struggles that mostly lead to a working setup.

(I'm still fighting with the .aff side, but I don't know much about hunspell.)

tv42 avatar Nov 16 '25 23:11 tv42