The Aspell utility is a multipurpose utility that can function as a ``ispell -a'' replacement, as an independent spell checker, and as a utility for managing dictionaries. Here is a brief summary of Aspell's command line options. For a more detailed explanation of how to use Aspell to perform a particular task please see one of the proceeding sections.
aspell [options] «command»
«command» is one of:
If Aspell is specified with out any command line options it will display a brief help screen and quit.
Aspell can also make use of a global or user configuration file. Each line of the configuration file has the format:
The environmental variable ASPELL_CONF may also be used and it overrides any options set in the configuration file. The format of the string is exactly the same as the configuration file except that semicolons ( ; ) are used instead of newlines.
To use Aspell as an independent spell checker type
aspell check «filename»Where «filename» is the file you want to check. Aspell will over right the original file with the corrected version. The original version is saved as «filename».bak unless it is turned off with the dont-backup option.
If the extension is .tex in will check the file in tex mode unless overridden by the mode option. If the extension is one of the extensions in the sgml-extension option (see section 3.5.4) it will check the file in sgml unless overridden by the mode option.
The exit command saves the file with the corrections made so far. If you want to quite without saving use control-C.
To actually use Aspell as an Ispell replacement simply follow the directions in section 2.6.
When given the pipe or -a command aspell goes into a pipe mode that is compatible with ``ispell -a''. Aspell also defines its own set of extensions to ispell pipe mode.
In this mode, Aspell prints a one-line version identification message, and then begins reading lines of input. For each input line, a single line is written to the standard output for each word checked for spelling on the line. If the word was found in the main dictionary, or your personal dictionary, then the line contains only a '*'.
If the word is not in the dictionary, but there are suggestions, then the line contains an '&', a space, the misspelled word, a space, the number of near misses, the number of characters between the beginning of the line and the beginning of the misspelled word, a colon, another space, and a list of the suggestions separated by commas and spaces.
Finally, if the word does not appear in the dictionary, and there are no suggestions, then the line contains a '#', a space, the misspelled word, a space, and the character offset from the beginning of the line. Each sentence of text input is terminated with an additional blank line, indicating that ispell has completed processing the input line.
These output lines can be summarized as follows:
To summarize these:
In addition to the above commands which are designed for Ispell compatibility Aspell also supports its own extension. All Aspell extensions follow the following format.
$$«command» [data]Where data may or may not be required depending on the particular command. Aspell currently supports the following command.
«num of items»: «item1», «item2», «etc»(Part of the preceding section was directly copied out of the Ispell manual)
As of version .27 of Aspell storing replacements pairs has a memory. Which means if you first store the replacement pair:
sicolagest -> psycolagestthen store the replacement pair
psycolagest -> psychologistThe replacement pair
sicolagest -> psychologistwill also get stored so that you don't have to worry about it.
To create the main word list from a list of words use the command
aspell --lang=«lang» create master ./«base» < «wordlist»where «base» is the name of the word list and «word list» is the list of words separated by white space. The ``./'' is important because without it aspell will create the word list in the normal word list directory. If you are trying to create a word list in a language other than english check the aspell data-dir (usually /usr/share/aspell, use ``aspell dump config'' to find out what it is on your system) to see if a language data file exists for your language. If not you will need to create one. See chapter 5 for more information on using Aspell with other languages.
This will create the file «base» in the current directory. To use the new word list copy the file to the normal word list directory (use ``aspell config'' to find out what it is) and use the option --master=«base».
A personal and replacement word list can be created in a similar fashion.
Because Aspell does not support any sort of affix compression like Ispell does Ispell word lists will not work as is. In order to use Ispell's word lists simply pipe the word list through ``ispell -e'' to expand the munched word lists.
The replacement word has each replacement pair on its own line in the following format
The dump command will simply dump the contents of a word list to stdout in a formate than can be read back in with aspell create.
If no word list is specified the command will act on the default one. For example the command
aspell dump masterwill simply dump the contents of the current master word list to stdout.
The run-together options control if Aspell excepts run together words as legal compounds. The default for this option is normally false but can be changed by the particular language in used. The other run-together-* options control the behavior of how aspell behaves with run-together words if the run-together options in enabled, the exact defaults for these options are language dependent. The run-together-limit options controls the maximum number of words that can be strung together, the default is normally 255. The run-together-min options controls the minimal length the individual components of the run together word can be, the default is normally 3. The option run-together-middle specifies an optional character that can appear between run-together words, the default is normally none.
Currently Aspell only supports run-together words when checking if a word is in the dictionary. When coming up with suggestions Aspell treats the word as a normal word and does not do anything special. This means that the suggestions will be virtually meaningless when the actual word is a run-together. I plan on more intelligently supporting run-together words when coming up with suggestions in a future version of Aspell.
Aspell now has rudimentary filter support. You can either select from individual filters or chose a filter mode. To select a filter mode use the mode option. You may chose from none, url, email, sgml, and tex. The default mode is url. Individual filters can be added with the option add-filter and remove with the rem-filter option. The currently available filters are url, email, sgml, tex as well as a bunch of filters which translate the text from one format to another.
This mode is exactly what it says. It turns off all filters.
The url filter/mode skips over URL's, host names, and email addresses. Because this filter is almost always useful and rarely does any harm it is enabled in all modes except none. To turn it off either select the none mode or use rem-filter option after the desired mode is selected.
The email filter/mode skips over quoted text. It currently does not support skipping over headers however a future version should. In the mean time I suggest you use Aspell with Newsbody which can be found at http://home.worldonline.dk/~byrial/newsbody/. The option email-skip controls the number of characters that can appear before the email quote char, the default is 10. The option add|rem-email-quote controls the characters that are considered quote characters, the default is ``>' and '|'.
The sgml filter/mode will skip over sgml commands. It currently does not handle nested < > unless they are in quotes. It also does it handle the null end tag (net) minimization feature of sgml such as
<emphasis/important/The option add|rem-sgml-check controls which sgml tags should always be checked. The default is ``alt''.
The option add|rem-sgml-extension controls which file extensions are recognized as sgml/html files. The default is html, htm, php, and sgml. The extension are not case sensitive so extensions like .HTM will also be recognized.
The sgml mode also enables a filter which will recognize sgml charter commands such as & and convert it into the proper iso8859-1 character. Currently only the iso8859-1 character set is used however in future versions it will convert it to the encoding that is specified in the language date file. You can specifically turn on this filter by enable the SGML&«charset»/«charset» filter.
The tex (all lowercase) filter/mode skips over TEX commands and parameters and/or options to certain command. It also skips over TEX comments by default. The option [dont-]tex-check-comments controls whether or not aspel will skip over TEX comments. The option add|rem-tex-command controls which TEX commands should have certain parameters and/or options also skipped over. Commands that are not specified will have all there parameters and/or options checked. The format for each item is
«command» «a list of p,P,o and Os»The first item is simple the command name. The second item controls which parameters to skip over. A 'p' skips over a parameter while a 'P' won't. Similar an 'o' will skip over an optional parameter while a 'O' won't. The first letter on the list will apply to the first parameter, the second letter will apply to the second parameter etc. If there are more parameters than letters Aspell will simply check them as normal. For example the option
add-tex-command rule ppwill skip over the first two parameters of the ``rule'' command while the option
add-tex-command foo Popwill check the first parameter of the ``foo'' command, skip over the next optional parameter, if it is present, and will skip over the second parameter -- even if the optional parameter is not present -- and will check any additional parameters.
A'*' at the end of the command is simply ignored. For example the option
enlargethispage pwill ignore the first parameter in both enlargethispage and enlargethispage*.
To remove a command simple use the rem-tex-command option. For example
rem-tex-command foowill remove the command foo, if present, from the list of TEX commands.
In order to understand what these suggestion modes do, a basic understanding of how aspell works is required. See section 6 for that. The suggestion modes are as follows.