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.6.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 an individual 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».
The compiled dictionary file is machine dependent. It is dependent on endian order, and the page size for the machine because they are mmaped in. Please do not distribute the compiled dictionaries unless you are only distributing them for a particular platform such as you would a binary. That is why is normally installed in ``lib/aspell: instead of ``share/aspell''.
Aspell is now also able to use special ``multi'' dictionaries. See section 3.4 form more information.
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 format 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 personalwill simply dump the contents of the current personal word list to stdout.
This option will currently not work with ``multi'' word lists.
As with precious versions of aspell you can specify the main dictionary to use via the -d or --master option. However as of Aspell .32 you can now also:
strip-accents yeswill strip accents from the english word list but not the must-accent word list. If the global strip-accents option is specified the local strip-accents options are ignored.
add english
strip-accents no
add must-accent
Aspell now provides the following multi dictionaries:
american-medium | american-large |
british-medium | british-large |
canadian-medium | canadian-large |
The word lists themselves all contain accented words however the strip-accents option is enabled by default for all the individual word lists. If you wish to use the accented words you can set the global strip-accents option to false or create a new multi word list.
To give you an idea of what the two sizes are like here is a random sample of 50 lower case words from the medium size:
asked behinds bowstring brute censure chlorines communistic conception consorting dichotomies disenfranchised eeriness encouraging erectnesses fluff friendless gourd gutted hods illiteracies insolvencies jalopies jettier kilted lackeys mangle mattocks minimally monotonic nagged neuritis pacifisms pedagogical porosities public reposed sandbagged schoolteachers spatters stickleback sweeping trivet twang twelfths ukuleles ultimate watersheds wavelengths whinniest woollinessand 50 words found only in the large size:
abidance airbase batrachian billfish breadroot brightener cabbageworm centurial clamberers contemporaneity costar cupolaed devourers difficile dugong dyad excursiveness fascinatingly flection freewheels gringos horsemint hygrophilous hyperplanes juncaceous loo madrepore meiosis meretriciously metathesis micro molluscoid phlegmy proconsulate professedly ravishers reabsorbs redecoration sidepiece skydiver sorrowfulness studbook tachistoscope toilworn topee unnavigable vitrescent waterlilies webworm workroomMany other dictionary sizes and varieties can be created. See the scowl/ directory in the source distribution for information on the different varieties you can create and section 3.3 for how to create an individual dictionary.
Aspell has support for either unconditionally accepting run-together words or only accepting certain words in compound formation.
Support for unconditionally accepting run-together words can either be turned on in the language data file or as a normal option via the run-together option. 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. Both the run-together-limit and run-together-min option may be specified in both the language data file or as a normal. The run-together-mid option, which may only be specified in the language data file, may be used to specify up to three optional characters that may appear between individual words.
In order for aspell to conditionally only accept certain words in compounds those words must be flagged when the compiled word list is being created. The format for each entry is
«word»:C[1][2][3]«middle char»The 1, 2, and 3 control if the word is allowed to appear in the begging, middle, or end of the compound, respectfully. More than one position flag may be specified. If none of them are specified it as assumed that the word may appear anywhere. The C is optional if 1, 2, or 3 is specified. The «middle char» represents an optional character that may appear after the word in the formation of the compound if the word is not at the end of the compound. If the letter is lowercase than the character may appear after the word, if it is in uppercase then that letter must appear after the compound. Only one letter may be specified and it must also be in the list of middle letters specified via the run-together-mid option. The run-together-limit option may also be used to specify the maximum number of words to string together.
For example the word list:
beg:1Means that the word ``beg'' may only appear at the begging of a word, the word ``mid'' at the middle, the word ``end'' at the end, and the word ``any'' any place. The word ``never'' is never accepted in a compound unless the run-together option is set. The word ``must'' may appear anywhere however it must be followed by an ``m'', while the word maybe may be followed by an ``m''. Given the above word list the following compounds or legal:
mid:2
end:3
any:C
never
must:CM
maybe:Cm
begmidendare all legal, but the following are not:
begany
mustmend
maybeend
maybemend
begmidIndividual words such as ``beg'' are always accepted.
mustend
neverany
When the run-together option is not set Aspell will only accept words that have been flagged in a run-together word. When the run-together option is set aspell will accept words which are as least as long as the value specified in the run-together-min option. If the words length is less than run-together-min then it will only accept the word if it has been flagged. When the run-together option is not set the run-together-min option is ignored all together.
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.