Just a note that I reported this in the past in Void Linux, they also used
the fix from OpenBSD hunspell port. See:

https://github.com/void-linux/void-packages/pull/18064

j.

On Sat, Jul 27, 2024 at 7:01 PM Rene Engelhard <r...@debian.org> wrote:

> Hi,
>
> Am 27.07.24 um 17:52 schrieb Jiri Belka:
> > `hunspell -D' shows either MacOS, obsolete or incorrect paths:
> Mac OS and obsolete ones, yes.
> > ---%>---
> > $ hunspell -D
> > SEARCH PATH:
> > .::/usr/share/hunspell:/usr/share/myspell:
> That is where the (system) dicts are
> > /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
> > ---%<---
>
> As seen here.
>
>
> > For example, hunspell in OpenBSD ports patches that in the following way:
> >
> > ---%>---
> > Index: src/tools/hunspell.cxx
> > --- src/tools/hunspell.cxx.orig
> > +++ 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"
> > ---%<---
>
> Why except solely for cosmetic?
>
> > * What led up to the situation?
> >
> > I was checking how hunspell might work with LO dictionaries.
> LO dictionaries *ARE* hunspell directories. LO looks in /usr/share/hunspell
> > * 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.
> It does.  What exactly doesn't work? Still assuming system dicts. (If you
> mean user dicts like below, you need  to state that from the beginning.)
> > * 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
> > *
> > ---%<---
>
> Ah, you are talking about user dicts..
>
>
> That might make sense, and then also the OpenBSD patch would make sensein
> part (one could just add the libreoffice dir)...
>
>
> Regards,
>
>
> Rene
>
>

Reply via email to