LinuxCommandLibrary

aspell

Spell-check files and standard input

TLDR

Spell check a single file

$ aspell check [path/to/file]
copy

List misspelled words from stdin
$ cat [path/to/file] | aspell list
copy

Show available dictionary languages
$ aspell dicts
copy

Run aspell with a different language (takes two-letter ISO 639 language code)
$ aspell --lang [cs]
copy

List misspelled words from stdin and ignore words from personal word list
$ cat [path/to/file] | aspell --personal [personal-word-list.pws] list
copy

SYNOPSIS

aspell [options] [command] [files...]

PARAMETERS

-c, --check
    Checks the spelling of a file interactively, allowing the user to accept, reject, or correct misspelled words.

-a, --suggest
    Operates in 'pipe' mode, reading words from standard input and outputting suggestions for misspelled ones. Ideal for programmatic use.

-l lang, --lang=lang
    Specifies the language dictionary to use (e.g., en_US for American English, es for Spanish).

--mode=mode
    Sets the operating mode, affecting how text is parsed. Common modes include none (plain text), email, html, sgml, and tex.

--master=dict
    Uses the specified master dictionary instead of the default dictionary for the selected language.

--add-extra-dict=dict
    Adds an additional dictionary to be used alongside the master dictionary for checking.

--personal=file
    Specifies the path to the personal dictionary file. If not set, a default location (e.g., ~/.aspell.en.pws) is used.

--add
    Adds words from standard input to the personal dictionary specified by --personal.

--del
    Removes words from standard input from the personal dictionary specified by --personal.

--conf=file
    Loads configuration settings from the specified file, overriding system-wide and user-specific defaults.

DESCRIPTION

Aspell is a free and open-source spell checker designed as a replacement for Ispell, aiming to provide superior functionality, especially in its suggestion algorithms and multilingual support. It boasts a highly intelligent suggestion mechanism that can often propose correct words even from severely misspelled input, by considering various forms of errors including phonetic and typographical mistakes.

Key features include comprehensive language support, allowing for the use of multiple dictionaries simultaneously, and context-aware suggestions that enhance accuracy. Aspell can operate in interactive mode for manual document checking or in pipe mode for seamless integration into other applications, scripts, or text editors. Its versatility is further extended by support for various document formats like plain text, email, HTML, SGML, and TeX, where it intelligently processes or ignores specific syntax elements to ensure accurate spell checking. Users can also customize its behavior by maintaining personal dictionaries for specialized vocabulary.

CAVEATS

Aspell's functionality is dependent on the availability of installed language dictionaries. If a specific language pack is not present, spell checking for that language will not be possible. While generally efficient, processing extremely large files or documents with complex embedded syntax (like heavily nested HTML) might experience slower performance. Its advanced suggestion algorithm, though powerful, can sometimes produce unexpected results for very unusual or obscure misspellings.

PERSONAL DICTIONARIES AND CUSTOMIZATION

Aspell allows users to extend its vocabulary through personal dictionaries. These are plain text files where users can add words (e.g., proper nouns, technical jargon, acronyms) that Aspell would otherwise flag as misspelled. Words can be added interactively during a check session or via the command line using options like --add. This feature makes Aspell highly customizable for specific domains or personal writing styles, ensuring that only genuine misspellings are highlighted.

HISTORY

GNU Aspell emerged in the late 1990s as a modern successor to the established Ispell program. Developed by Kevin Atkinson as part of the GNU project, its primary goal was to improve upon Ispell's limitations, specifically its suggestion quality and lack of robust multilingual capabilities. The development focused on creating a more sophisticated suggestion algorithm that could better handle diverse errors and a flexible framework for managing multiple dictionaries and character sets. The first stable release was made available in 2000, establishing Aspell as a powerful and adaptable spell-checking solution for the open-source community.

SEE ALSO

hunspell(1), ispell(1), grep(1), sed(1), vi(1), emacs(1)

Copied to clipboard