The behavior of Aspell can be changed by any number of options which can be specified at either the command line, the environmental variable ASPELL_CONF, a personal configuration file, or a global configuration file. Options specified on the command line override options specified by the environmental variable. Options specified by the environmental variable override options specified by either of the configurations files. Finally options specified by the personal configuration file override options specified in the global configuration file. Options specified in the environmental variable ASPELL_CONF, a personal configuration file, or a global configuration file will take effect no matter how Aspell is used which includes being used by other applications.
Aspell has three basic type of options: boolean, value, and list. Boolean options are either enabled or disabled, value options take a specific value, and list options can either have entries added or removed from the list.
All options specified at the command line have the following basic format:
--«option»[=«value»]where the '=' can be replaced by whitespace.
However some options also have single letter abbreviations of the form:
To enable a boolean option simply special the option with out any corresponding value. For example to ignore accents when checking words use ``--ignore-accents''. To disable a boolean option prefix the option name with a ``dont-''. For example to not ignore accents when checking words use ``--dont-ignore-accents''.
If a boolean option has a single letter abbreviation simply give the letter corresponding to either enabling or disabling the option with out any corresponding value. For example to consider run-together words legal use ``-C'' or to consider them illegal use ``-B''
To specify a value option simply specify the option with its corresponding value. For example to set the filter mode to Tex use ``--mode=tex''.
If a value option has a single letter shortcut simply specify the single letter short cut with its corresponding value. For example to use a large american dictionary use ``-d american-lrg''.
To add a value to the list prefix the option name with a ``add-'' and then specify the value to add. For example to add the URL filter use ``--add-filter url''. To remove a value from a list option prefix the option name with a ``rem-'' and then specify the value to remove. For example to remove the URL filter use ``--rem-filter url''. To remove all items from a list prefix the option name with a ``rem-all'' without specify any value. For example to remove all filters use ``--rem-all-filter''.
Aspell can also accept options via a personal or global configuration file. The exact files to used are specified by the options per-conf and conf respectfully but the personal configuration file is normally ``.aspell.conf'' located in the HOME directory and the global one is normally ``aspell.conf'' which is located in the etc directory which is normally ``/usr/etc'' or ``/usr/local/etc''. To find out the particular values for your particular system use ``aspell dump config''.
Each line of the configuration file has the format:
Comments may also be included by preceding them with a '#' as anything from a ``#'' to a newline is ignored. Blank lines are also allowed.
Values set in the personal configuration file override those in the global file. Options specified at either the command line or via an environmental variable override those specified by either configuration file.
To specify a boolean option simply include the option followed by a ``true'' to enable it or a ``false'' to disable it. For example to allow run-together words use ``run-together true''.
To specify a value option simply include the option followed by the corresponding option. For example to set the default language to german use ``lang german''.
To add a value to the list prefix the option name with a ``add-'' and then specify the value to add. For example to add the URL filter use ``add-filter url''. To remove a value from a list option prefix the option name with a ``rem-'' and then specify the value to remove. For example to remove the URL filter use ``rem-filter url''. To remove all items from a list prefix the option name with a ``rem-all'' without specify any value. For example to remove all filters use ``rem-all-filter''.
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.
The following is a list of available options broken down by category. Each entry has the following format:
Where single letter options are specified as they would appear at the command line, ie with the preceding dash. Boolean single letter options are specified in the following format:
-«abbreviation to enable»|-«abbreviation to disable»«Option» is one of the following: boolean, string, file, dir, integer, or list. String, file, dir, and integer types are all value options which can only take a specific type of value.
The following options may be used to control which dictionaries to use and how they behave (see section 5 for more information):
These options control the beahvior of Aspell when checking documents.
These options modify the behavior of the various filters (see section 4.4.1 for more information):
These may be used to control the behavior of run-together words (see section 7.4 for more information):
Misc. other options that don't fall under any other catagory
To find out the current value of all the options use the command ``aspell dump config''. This will dump the current configuration to standard output. The format of the contents dumped is such that it can be used as either the global or personal configuration file.
To find out the current value of a particular option use ``aspell config «option»''. This will print out the value of «option» to stdout and nothing else.
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/This filter will also translate sgml characters of the form ``&#num;''. Other sgml characters such as ``&'' will simply be skiped over so that the word ``amp'' for example will not be spell checked. Eventually full support for properly translating sgml characters will be added.
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 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.
The prefix option is there to allow Aspell to easily be relocated. Changing prefix will change all directory names relative to the new prefix that are not explicitly set. For example if prefix was ``/usr/local/aspell'' and dict-dir has a default value of ``/usr/local/aspell/dict'' than changing prefix to ``/opt/aspell'' will also change the default value of dict-dir to ``/opt/aspell/dict''. Note that modifying prefix will only effect the default compiled in values of directories. If a directory option is explicitly given a value than changing the value of prefix has no effect on that directory option.
Aspell .33 and better will, in general, give a higher priority to certain misspelling which are likely to be due to typos such as ``teh'' instead of ``the'' or ``hapoy'' instead of ``happy''. However in order to do this well Aspell needs to know the layout of the keyboard. The keyboard definition file simply identifies keys that are right next to each other. The file has an extension of .kbd and each line consists of two letters corresponding to two keys that are right next to each other. For example the line ``as'' will indicate that 'a' and 's' are right next to each other. If ``as'' is listed as a entry it is not necessary to list ``sa'' as an entry as that will be done automatically. Also by ``right next to each other'' I mean to keys that are close enough together that it is easy to type one instead of the other. On most keyboards this means keys that are to the left or to the right of each other and not keys that are below or above it.
The default for this option is normally ``standard''. However the default can be changed via the language data file. The normal default, ``standard'', should work well for most QWERTY like keyboard layouts. It may need minor adjusting for foreign keyboards. The ``dvorak'' option can for a Dvorak layout. When creating a keyboard definition file for a foreign language please keep in mind that Aspell completely ignores accents when scoring words so that the key 'o' and 'ö' will appear to be the same key to aspell even if they are in fact separate keys on your keyboard.
In order to understand what these suggestion modes do, a basic understanding of how aspell works is required. See section 8 for that. The suggestion modes are as follows.