enchant
Spell check and correct text
SYNOPSIS
enchant [OPTIONS] [FILE...]
enchant -l
enchant -d <DICTIONARY> <WORD>
enchant -a <DICTIONARY> <WORD>
PARAMETERS
--add-to-personal=
Adds WORD to the user's persistent personal dictionary.
--add-to-session=
Adds WORD to the current session's temporary dictionary.
--brief
Only prints misspelled words, suppressing other output like suggestions or statistics.
-d
Uses the specified DICTIONARY for spell checking (e.g., 'en_US', 'fr').
-L
Uses a dictionary for the specified LANGUAGE, auto-detecting the best match.
-l, --list-dictionaries
Lists all available dictionaries that enchant can utilize.
-a, --suggest
Provides alternative spelling suggestions for misspelled words.
--no-pdict
Disables the use of the personal dictionary during spell checking.
--personal-dict-dir=
Specifies an alternative directory for personal dictionaries.
--show-errors
Explicitly displays only misspelled words found in the input (often default when checking files).
-v, --verbose
Enables verbose output, providing more details about the spell checking process.
-V, --version
Displays the enchant version information and exits.
-h, --help
Displays a help message with command-line options and exits.
DESCRIPTION
enchant is a powerful and flexible spell checking library and command-line tool. It acts as a generic front-end for various underlying spelling checker backends, such as Hunspell, Aspell, and Ispell. This architecture allows enchant to provide a consistent API for applications, regardless of which specific spelling engine is installed or preferred by the user.
It supports multiple languages and can handle different dictionary formats. Users can check the spelling of words or entire files, receive suggestions for misspelled words, and manage personal dictionaries. enchant is widely used in text editors, word processors, and other applications that require robust spell checking capabilities, offering a unified and extensible solution.
CAVEATS
enchant relies on underlying spelling backends (like Hunspell or Aspell) and their respective dictionaries to be installed on the system. If no suitable backend or dictionary is found for a requested language, spell checking might fail or be unavailable.
Dictionary quality and coverage can vary depending on the backend and language pack used. Users should ensure they have appropriate dictionaries installed for their specific needs.
BACKENDS AND DICTIONARIES
enchant works by loading 'backends,' which are modules that wrap specific spell checking libraries. To use enchant effectively for a particular language, the corresponding backend (e.g., libenchant-2-hunspell.so for Hunspell) and its associated language dictionaries (e.g., hunspell-en-us) must be installed on your system. You can list available backends using --list-brokers and dictionaries using -l.
PERSONAL DICTIONARIES
Users can maintain personal dictionaries to store words not found in the main dictionaries but which are correctly spelled (e.g., proper nouns, jargon, technical terms). These can be added via the command line (--add-to-personal) or configured through application settings that use enchant. Their persistence and location might depend on enchant configuration and backend choices.
HISTORY
enchant was created to provide a consistent, unified API for spell checking, abstracting away the differences between various existing spell checking libraries like Ispell, Aspell, and Hunspell. This approach aimed to simplify the development of applications requiring spell checking by allowing them to use a single interface, rather than needing to integrate with multiple distinct libraries. It gained traction as a flexible solution in the open-source ecosystem, particularly for desktop environments and applications that needed robust multi-language spell checking capabilities without being tied to a specific backend technology.