Dear Maintainer,
`hunspell -D' shows either MacOS, obsolete or incorrect paths:
---%>---
$ hunspell -D
SEARCH PATH:
.::/usr/share/hunspell:/usr/share/myspell:/usr/share/myspell/dicts:/Library/Spelling:/home/jiri/.openoffice.org/3/user/wordbook:/home/jiri/.openoffice.org2/user/wordbook:/home/jiri/.openoffice.org2.0/user/wordbook:/home/jiri/Library/Spelling:/opt/openoffice.org/basis3.0/share/dict/ooo:/usr/lib/openoffice.org/basis3.0/share/dict/ooo:/opt/openoffice.org2.4/share/dict/ooo:/usr/lib/openoffice.org2.4/share/dict/ooo:/opt/openoffice.org2.3/share/dict/ooo:/usr/lib/openoffice.org2.3/share/dict/ooo:/opt/openoffice.org2.2/share/dict/ooo:/usr/lib/openoffice.org2.2/share/dict/ooo:/opt/openoffice.org2.1/share/dict/ooo:/usr/lib/openoffice.org2.1/share/dict/ooo:/opt/openoffice.org2.0/share/dict/ooo:/usr/lib/openoffice.org2.0/share/dict/ooo
AVAILABLE DICTIONARIES (path is not mandatory for -d option):
/usr/share/hunspell/en_US
/usr/share/hunspell/cs_CZ
/usr/share/hunspell/cs
/usr/share/hunspell/it_IT
/usr/share/hunspell/it_CH
/usr/share/myspell/dicts/cs
/usr/share/myspell/dicts/cs_CZ
LOADED DICTIONARY:
/usr/share/hunspell/en_US.aff
/usr/share/hunspell/en_US.dic
---%<---
For example, hunspell in OpenBSD ports patches that in the following way:
+++ src/tools/hunspell.cxx
@@ -116,28 +116,14 @@
#include "../parsers/odfparser.hxx"
#define LIBDIR \
- "/usr/share/hunspell:" \
- "/usr/share/myspell:" \
- "/usr/share/myspell/dicts:" \
- "/Library/Spelling"
+ "${PREFIX}/share/hunspell:" \
+ "${LOCALBASE}/share/myspell:" \
+ "${LOCALBASE}/share/myspell/dicts:" \
+ "${LOCALBASE}/share/mozilla-dicts"
#define USEROOODIR { \
- ".openoffice.org/3/user/wordbook", \
- ".openoffice.org2/user/wordbook", \
- ".openoffice.org2.0/user/wordbook",\
- "Library/Spelling" }
+ ".config/libreoffice/4/user/wordbook" }
#define OOODIR \
- "/opt/openoffice.org/basis3.0/share/dict/ooo:" \
- "/usr/lib/openoffice.org/basis3.0/share/dict/ooo:" \
- "/opt/openoffice.org2.4/share/dict/ooo:" \
- "/usr/lib/openoffice.org2.4/share/dict/ooo:" \
- "/opt/openoffice.org2.3/share/dict/ooo:" \
- "/usr/lib/openoffice.org2.3/share/dict/ooo:" \
- "/opt/openoffice.org2.2/share/dict/ooo:" \
- "/usr/lib/openoffice.org2.2/share/dict/ooo:" \
- "/opt/openoffice.org2.1/share/dict/ooo:" \
- "/usr/lib/openoffice.org2.1/share/dict/ooo:" \
- "/opt/openoffice.org2.0/share/dict/ooo:" \
- "/usr/lib/openoffice.org2.0/share/dict/ooo"
+ "${LOCALBASE}/lib/libreoffice/share/wordbook"
#define HOME getenv("HOME")
#define DICBASENAME ".hunspell_"
#define LOGFILE "/tmp/hunspell.log"
---%<---
Cf.
https://raw.githubusercontent.com/openbsd/ports/master/textproc/hunspell/patches/patch-
src_tools_hunspell_cxx .
---%>---
$ hunspell -D 2>&1 | awk 'function cmd(path) { system(sprintf("ls -ld \"%s\"",
path)) } /SEARCH PATH:/ { getline; split($0, paths, ":"); for (i in paths)
paths[i] ? cmd(paths[i]) : true }'
drwx--x---+ 80 jiri jiri 8192 Jul 27 17:07 .
drwxr-xr-x. 2 root root 170 Jul 9 12:46 /usr/share/hunspell
drwxr-xr-x. 3 root root 19 Jan 5 2024 /usr/share/myspell
drwxr-xr-x. 2 root root 68 Jan 5 2024 /usr/share/myspell/dicts
ls: cannot access '/Library/Spelling': No such file or directory
ls: cannot access '/home/jiri/.openoffice.org/3/user/wordbook': No such file or
directory
ls: cannot access '/home/jiri/.openoffice.org2/user/wordbook': No such file or
directory
ls: cannot access '/home/jiri/.openoffice.org2.0/user/wordbook': No such file
or directory
ls: cannot access '/home/jiri/Library/Spelling': No such file or directory
ls: cannot access '/opt/openoffice.org/basis3.0/share/dict/ooo': No such file
or directory
ls: cannot access '/usr/lib/openoffice.org/basis3.0/share/dict/ooo': No such
file or directory
ls: cannot access '/opt/openoffice.org2.4/share/dict/ooo': No such file or
directory
ls: cannot access '/usr/lib/openoffice.org2.4/share/dict/ooo': No such file or
directory
ls: cannot access '/opt/openoffice.org2.3/share/dict/ooo': No such file or
directory
ls: cannot access '/usr/lib/openoffice.org2.3/share/dict/ooo': No such file or
directory
ls: cannot access '/opt/openoffice.org2.2/share/dict/ooo': No such file or
directory
ls: cannot access '/usr/lib/openoffice.org2.2/share/dict/ooo': No such file or
directory
ls: cannot access '/opt/openoffice.org2.1/share/dict/ooo': No such file or
directory
ls: cannot access '/usr/lib/openoffice.org2.1/share/dict/ooo': No such file or
directory
ls: cannot access '/opt/openoffice.org2.0/share/dict/ooo': No such file or
directory
ls: cannot access '/usr/lib/openoffice.org2.0/share/dict/ooo': No such file or
directory
$ ls -l ~/.config/libreoffice/4/user/wordbook
total 4
-rw-r--r--. 1 jiri jiri 3917 Jul 20 22:04 standard.dic
---%<---
* What led up to the situation?
I was checking how hunspell might work with LO dictionaries.
* What exactly did you do (or not do) that was effective (or ineffective)?
Next, I checked if `hunspell' is able to read my LO dict, but it wasn't.
* What was the outcome of this action?
hunspell returns "bad (rejected) work - with '&', that is, with suggestion -
for a work
which is correct and present in my dictionary; an example:
---%>---
$ hunspell -d cs_CZ <<< "autobusáků"
Hunspell 1.7.2
& autobusáků 1 0: autobusů
---%<---
* What outcome did you expect instead?
I expected the previous command would return '*' as the word is present it my
LO user dict:
---%>---
$ grep -n 'autobusáků' ~/.config/libreoffice/4/user/wordbook/standard.dic
114:autobusáků
---%<---
The workaround is to use `-p
~/.config/libreoffice/4/user/wordbook/standard.dic', but I would
expect `hunspell' would use such a path automatically - see OpenBSD hunspell
diff.
---%>---
hunspell -d cs_CZ -p ~/.config/libreoffice/4/user/wordbook/standard.dic <<<
"autobusáků"
error - iconv: ISO8859-2 -> UTF-8
Hunspell 1.7.2
*
---%<---