ENCHANT(5) File Formats Manual ENCHANT(5)

# [NAME](#NAME)

Enchant - enchant language tags, ordering files and personal word lists

# [LANGUAGE TAGS](#LANGUAGE_TAGS)

Enchant identifies dictionaries by their language tag. A language tag is typically an IETF BCP 47 language tag of the form *LANGUAGE\_COUNTRY*; for example, *en\_US* or *zh\_SG*. Multiple dictionaries may be used together by giving a comma-separated list; for example *en\_GB,fr\_FR*. This can be useful for checking multi-lingual text, or for using specialised word lists for a particular subject, project or document (these might have names such as *en-medical* or *en-my-novel*).

# [ORDERING FILE](#ORDERING_FILE)

Enchant uses global and per-user ordering files named *enchant.ordering* to decide which spelling provider to use for particular languages. The per-user file takes precedence.

The ordering file takes the form *language\_tag:&lt;comma-separated list of spelling* *providers&gt;*. To see what dictionaries are available, run *enchant-lsmod-2*. ‘\*’ is used to mean “use this ordering for all languages, unless instructed otherwise.” For example:

\*:aspell,hunspell,nuspell  
en:aspell,hunspell,nuspell  
en\_GB:hunspell,nuspell,aspell  
fr:hunspell,nuspell,aspell

# [PERSONAL WORD LISTS](#PERSONAL_WORD_LISTS)

Personal word lists are simple plain text files with one word per line. The name of the file starts with the language tag and ends *.dic*. Each personal word list has a corresponding exclude file, ending in *.exc*, which lists words that are found in the dictionary but that the user wants to be considered invalid. The files are stored in an Enchant configuration directory; see **FILES AND DIRECTORIES** below. Lines starting with a hash sign ‘#’ are ignored.

## [SHARING PERSONAL WORD LISTS BETWEEN SPELL-CHECKERS](#SHARING_PERSONAL_WORD_LISTS_BETWEEN_SPELL-CHECKERS)

It is possible, and usually safe, to share Enchant’s personal word lists with other spelling checkers that use the same format (note that other spell-checkers may not support comments!). The spell-checkers known to be compatible are Hunspell, Nuspell and Ispell. (Although Enchant does not support Ispell as a provider, it’s still fine to share word lists with it.) Other spell-checkers supported by Enchant are either incompatible, or have no personal word list mechanism. There may well be yet other spell-checkers, unknown to Enchant, that use the same format.

Some applications use Hunspell or Nuspell, but store the personal word list under another name or in another location; Firefox and Thunderbird do this. Firefox also seems to reorder its word list when updating it; again, this is OK, as the result is still in the same format.

To share word lists with Enchant, find the other spelling checker’s word list file, e.g. *~/.hunspell\_fr\_FR* or *~/.config/nuspell/fr\_FR*, and merge it with the corresponding Enchant file, in this case *~/.config/enchant/fr\_FR.dic*. Use the following command, replacing *ENCHANT-DICT* and *OTHER-DICT* with the corresponding dictionary file names:

cat ENCHANT-DICT OTHER-DICT | sort -u &gt; merged.txt

Take a look at *merged.txt* to check the merge has worked, then

mv merged.txt ENCHANT-DICT  
rm OTHER-DICT  
ln -s OTHER-DICT ENCHANT-DICT

to replace the other dictionary file with a link to the Enchant dictionary, again filling in the name of the dictionary files.

# [ENVIRONMENT](#ENVIRONMENT)

The following variables affect the behavior of Enchant:

[*ENCHANT\_CONFIG\_DIR*](#ENCHANT_CONFIG_DIR)

A directory in which Enchant should look for configuration files. See below.

[*G\_MESSAGES\_DEBUG*](#G_MESSAGES_DEBUG)

Enchant uses GLib's log functions, with the domain *libenchant*, to output messages useful for debugging. Setting *G\_MESSAGES\_DEBUG* to *libenchant* will cause Enchant to output debugging messages to standard error. See the GLib documentation for more details.

# [FILES AND DIRECTORIES](#FILES_AND_DIRECTORIES)

Enchant looks in the following places for user files, in decreasing order of precedence:

[*ENCHANT\_CONFIG\_DIR*](#ENCHANT_CONFIG_DIR~2)

(If the environment variable is set.)

[*XDG\_CONFIG\_HOME/enchant* (non-Windows systems)](#XDG_CONFIG_HOME/enchant)

Default: *~/.config/enchant*

[*CSIDL\_LOCAL\_APPDATA\\enchant* (Windows systems)](#CSIDL_LOCAL_APPDATA)

Default: *C:\\Documents and Settings\\*username*\\Local Settings\\Application Data\\enchant*

Dictionaries for some providers are looked for in a subdirectory with the same name as the provider, for example *~/.config/enchant/hunspell*. Currently this works for Hspell, Hunspell, Nuspell and Voikko.

Providers also look in specific system directories, and in some cases and user directories, for their dictionaries; see the documentation for each provider.

In addition, Enchant looks in the following systems directories for ordering files:

*/etc/enchant-2*

(Or the equivalent location relative to the enchant library for a relocatable build.)

*/usr/share/enchant-2*

(Or the equivalent location relative to the enchant library for a relocatable build.)

# [SEE ALSO](#SEE_ALSO)

[**enchant-2**(1)](/man/os/enchant2/enchant-2.1), [**enchant-lsmod-2**(1)](/man/os/enchant2/enchant-lsmod-2.1)

# [AUTHOR](#AUTHOR)

Written by Dom Lachowicz and Reuben Thomas.

---

Document: enchant(5) from enchant2 2.8.21-r1 (Chainguard OS)
Source: https://github.com/rrthomas/enchant
