Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"hunspell -D /dev/null" could handle empty $LANG better #687

Open
skangas opened this issue Aug 26, 2020 · 0 comments
Open

"hunspell -D /dev/null" could handle empty $LANG better #687

skangas opened this issue Aug 26, 2020 · 0 comments

Comments

@skangas
Copy link

skangas commented Aug 26, 2020

Using hunspell 1.7.0 on Debian GNU/Linux (bullseye/sid):

@(#) International Ispell Version 3.2.06 (but really Hunspell 1.7.0)

I think hunspell could handle unset or empty $LANG a bit better:

$ hunspell -D /dev/null
SEARCH PATH:
.::/usr/share/hunspell:/usr/share/myspell:/usr/share/myspell/dicts:/Library/Spelling:/home/skangas/.openoffice.org/3/user/wordbook:/home/skangas/.openoffice.org2/user/wordbook:/home/skangas/.openoffice.org2.0/user/wordbook:/home/skangas/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/sv_FI
/usr/share/hunspell/sv_SE
/home/skangas/.openoffice.org/3/user/wordbook/standard
Can't open affix or dictionary files for dictionary named "default".

Here is the locale which produces that:

$ locale
LANG=
LANGUAGE=
LC_CTYPE=sv_SE.UTF-8
LC_NUMERIC="POSIX"
LC_TIME=C
LC_COLLATE=C
LC_MONETARY="POSIX"
LC_MESSAGES="POSIX"
LC_PAPER="POSIX"
LC_NAME="POSIX"
LC_ADDRESS="POSIX"
LC_TELEPHONE="POSIX"
LC_MEASUREMENT="POSIX"
LC_IDENTIFICATION="POSIX"
LC_ALL=

If I export $LANG, it works better:

$ export LANG=en_US.UTF-8
$ hunspell -D /dev/null
SEARCH PATH:
.::/usr/share/hunspell:/usr/share/myspell:/usr/share/myspell/dicts:/Library/Spelling:/home/skangas/.openoffice.org/3/user/wordbook:/home/skangas/.openoffice.org2/user/wordbook:/home/skangas/.openoffice.org2.0/user/wordbook:/home/skangas/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/sv_FI
/usr/share/hunspell/sv_SE
/home/skangas/.openoffice.org/3/user/wordbook/standard
LOADED DICTIONARY:
/usr/share/hunspell/en_US.aff
/usr/share/hunspell/en_US.dic

Could hunspell perhaps be a bit more helpful in these cases? $LANG should properly never be unset, but many other programs do not complain about it. I would suggest to either use some reasonable default, likely "en_US.UTF-8", or otherwise to warn that $LANG is unset and that this will make it impossible to find a ".dic" file.

Thanks in advance.

@skangas skangas changed the title "hunspell -D /dev/null" could handle empty LANG better "hunspell -D /dev/null" could handle empty $LANG better Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant