Home / Alt manpages / enchant-lsmod-2(1)

  • enchant-lsmod-2(1)
  • User command
  • linux

Inspect Enchant Providers and Dictionaries with enchant-lsmod-2

Spell-check says there is no dictionary, and enchant-lsmod-2 tells you who is to blame: the provider, the language or your typo. You will answer three practical questions: which Enchant providers are installed, which dictionaries they expose, and which provider Enchant picks for a language. Everything here only inspects. Nothing installs dictionaries, edits configuration or needs elevated privileges. Allow about five minutes.

1. Check the installed command and version

This guide uses the enchant-2 package installed on the test machine, version 2.3.3-2build2. The executable reports Enchant 2.3.3. Your output may differ if your distribution ships another package release, provider set or dictionary set.

$ command -v enchant-lsmod-2
/usr/bin/enchant-lsmod-2
$ enchant-lsmod-2 -version
enchant-lsmod-2 2.3.3

Checkpoint

If command -v prints nothing, stop and install the Enchant package through your normal package-management process. Do not add a guessed binary to PATH just to make the check pass.

2. List the installed providers

Run the command with no options. The default action lists the available spell-checker providers, not every language dictionary.

$ enchant-lsmod-2
aspell (Aspell Provider)
hspell (Hspell Provider)
hunspell (Hunspell Provider)

Names and order come from the local installation. A provider is a back-end Enchant can use. Its presence does not mean every language dictionary for it is installed, so treat this output as an inventory, not proof that a given language can be checked.

3. List dictionaries for all available languages

Use -list-dicts for the language-level view. Each line gives a language tag and the provider supplying its dictionary.

$ enchant-lsmod-2 -list-dicts
en (aspell)
en_AU (aspell)
en_CA (aspell)
en_GB (aspell)
en_US (aspell)
et_EE (hunspell)

Language tags are data, not shell variables. Copy the exact tag you need from this list. Here en_GB and en_US are separate entries, and the generic en entry is present too. If your output is empty or lacks your language, the command cannot create that dictionary by itself.

4. Check the selected provider for one language

Pass a language tag to -lang. It reports which provider and dictionary Enchant will use for that language.

$ enchant-lsmod-2 -lang en_GB
en_GB (aspell)

Omitting the language argument asks for all languages, but -list-dicts is clearer when you want a complete inventory. Use the exact spelling and punctuation from the dictionary list, because a locale written in another form may not match the installed entry.

Checkpoint

You should now have an inventory from -list-dicts and a selection result from -lang. The first says what is available. The second says what Enchant chooses for one requested language.

5. Inspect extra word characters when needed

-word-chars shows extra characters that count as part of a word for a language, when the provider supplies that information. The manual describes it as a specialist query, so it does not replace checking dictionary availability.

$ enchant-lsmod-2 -word-chars en_GB

An empty result can be valid. On this installation the command exits successfully and prints no characters for en_GB. Check the status separately when scripting:

$ enchant-lsmod-2 -word-chars en_GB
$ printf 'exit status: %s\n' "$?"
exit status: 0

Tip

An empty line does not mean the dictionary is missing. Use -lang or -list-dicts to answer that question.

6. Diagnose a missing language

Querying an unavailable language is safe, and the failure looks different from a successful lookup. This deliberately uses a tag that is absent from the local list:

$ enchant-lsmod-2 -lang zz_ZZ
No dictionary available for 'zz_ZZ': No word lists can be found for the language "zz".
$ printf 'exit status: %s\n' "$?"
exit status: 1

The exact wording varies with the Enchant release. The signals that matter are the "no dictionary" message and the non-zero exit status. Check the tag first, then check the installed package and provider data through your distribution. There is no undo step because the command changes nothing.

A misspelt option fails in the same read-only way:

$ enchant-lsmod-2 -not-an-option
Invalid argument -not-an-option
enchant-lsmod-2 [[-lang|-word-chars] [language_tag]|-list-dicts|-help|-version]
$ printf 'exit status: %s\n' "$?"
exit status: 1

Use -help for the concise syntax summary.

Tip

Do not add sudo to any example here. Elevated privileges cannot manufacture a missing dictionary, and they only make an unprivileged inspection harder to audit.

Done means

  • Version identified. enchant-lsmod-2 -version named the installed Enchant release.
  • Providers listed. The no-option query showed which providers are available.
  • Dictionaries listed. -list-dicts showed the installed language and provider pairs.
  • Selection confirmed. -lang showed the provider chosen for the language you care about.
  • Empty is valid. You treated an empty -word-chars result as a valid answer until other checks say otherwise.
  • Failure read properly. A missing language was diagnosed from its message and non-zero exit status, without changing system state.