aspell: Notes on Various Filters and Filter Modes
1
1 4.4.1 Notes on Various Filters and Filter Modes
1 -----------------------------------------------
1
1 Aspell now has filter support. You can either select from individual
1 filters or choose a filter mode. To select a filter mode use the
1 `mode' option. You may choose from `none', `url', `email', `sgml',
1 `ccpp', `tex' and any other available on your system. The default mode
1 is `url'. Individual filters can be added with the option `add-filter'
1 and removed with the `rem-filter' option. The currently available
1 filters are `url', `email', `sgml' and `tex', `latex' (alias for
1 `tex'), `nroff', `context', as well as a bunch of filters which
1 translate the text from one format to another.
1
1 To check which filters are available use `aspell dump filters'. To
1 check which filter modes are available use `aspell dump modes'. The
1 `aspell help' command will also list all available filter and filter
1 modes.
1
1 4.4.1.1 None Filter Mode
1 ........................
1
1 The `none' mode is exactly what it says. It turns off all filters.
1
1 4.4.1.2 URL Filter
1 ..................
1
1 The `url' filter/mode skips over URLs, host names, and email addresses.
1 Because this filter is almost always useful and rarely does any harm
1 it is enabled in all modes except `none'. To turn it off either select
1 the `none' mode or use `rem-filter' option _after_ the desired mode is
1 selected.
1
1 4.4.1.3 Email Filter
1 ....................
1
1 The `email' filter mode skips over quoted text. It currently does not
1 support skipping over headers however a future version should. In the
1 meantime I suggest you use Aspell with Newsbody which can be found at
1 `http://home.worldonline.dk/~byrial/newsbody/'. The option
1 `email-skip' controls the number of characters that can appear before
1 the email quote character, the default is 10. The option
1 `add|rem-email-quote' controls the characters that are considered quote
1 characters, the defaults are `>' and `|'.
1
1 4.4.1.4 SGML Filter
1 ...................
1
1 The SGML filter allows you to spell check SGML, HTML, XHTML, and XML
1 files. In most cases everything within a tag `<tag attrib=value
1 attrib2="a whole sentence">' will be skipped by the spell checker. The
1 SGML/HTML/XML that Aspell supports is a slight superset of most DTDs
1 (Document Type Definitions) and can spell check the often non-conforming
1 HTML found on the web.
1
1 Two configuration options, `sgml-skip' and `sgml-check', allow you
1 to control what is spell checked. The tag and attribute names specified
1 are case insensitive.
1
1 sgml-skip
1 This is a list of tags whose contents will also be skipped by the
1 spell checker. For example, if you wish to leave a misspelling in
1 a document and not have them flagged as misspellings, you could
1 surround them with a <nospellcheck> tag:
1 <TD><FONT size=2><NOSPELLCHECK>leviosa</NOSPELLCHECK>
1 is what Mr. Potter said</FONT></TD>
1 And put that word in the skip config directive:
1 add-sgml-skip nospellcheck
1
1 sgml-check
1 This is a list of attributes whose values you do want spell
1 checked. By default, 'alt' (<img> alternate text) is a member of
1 the check list since it is text that is seen by a web page viewer.
1 You may also want 'value' to be on the check list since that is
1 the text put on buttons:
1 add-sgml-check value
1 In this case `<input type=button value="Donr">' will be flagged as
1 a misspelling.
1
1 This filter will also translate SGML characters of the form
1 `&#num;'. Other SGML characters such as `&' will simply be skipped
1 over so that the word `amp', for example, will not be spell checked.
1 Eventually full support for properly translating SGML characters will
1 be added.
1
1 4.4.1.5 HTML Filter
1 ...................
1
1 The `html' filter is like the SGML Filter Mode but specialized for
1 HTML. By default, 'script' and 'style' are members of the skip list in
1 HTML mode.
1
1 4.4.1.6 TeX/LaTeX Filter
1 ........................
1
1 The `tex' (all lowercase) filter mode skips over TeX commands and
1 parameters and/or options to certain commands. It also skips over TeX
1 comments by default. The option `[dont-]tex-check-comments' controls
1 whether or not Aspell will skip over TeX comments. The option
1 `add|rem-tex-command' controls which TeX commands should have certain
1 parameters and/or options also skipped over. Commands that are not
1 specified will have all their parameters and/or options checked. The
1 format for each item is
1
1 <command> <a list of p,P,o and Os>
1
1 The first item is simply the command name. The second item controls
1 which parameters to skip over. A 'p' skips over a parameter while a
1 'P' doesn't. Similarly an 'o' will skip over an optional parameter
1 while an 'O' doesn't. The first letter on the list will apply to the
1 first parameter, the second letter will apply to the second parameter
1 etc. If there are more parameters than letters Aspell will simply
1 check them as normal. For example the option
1
1 add-tex-command rule pp
1
1 will skip over the first two parameters of the `rule' command while the
1 option
1
1 add-tex-command foo Pop
1
1 will _check_ the first parameter of the `foo' command, skip over the
1 next optional parameter, if it is present, and will skip over the
1 second parameter -- even if the optional parameter is not present --
1 and will check any additional parameters.
1
1 A `*' at the end of the command is simply ignored. For example the
1 option
1
1 enlargethispage p
1
1 will ignore the first parameter in both `enlargethispage' and
1 `enlargethispage*'.
1
1 To remove a command simply use the `rem-tex-command' option. For
1 example
1
1 rem-tex-command foo
1
1 will remove the command foo, if present, from the list of TeX commands.
1
1 The TeX filter mode is also available via `latex' alias name.
1
1 4.4.1.7 Texinfo Filter
1 ......................
1
1 The `texinfo' filter allows you to spell check Texinfo files. It will
1 skip over any Texinfo commands and their parameters when appropriate.
1 It will also skip over some Texinfo environments such as `example'.
1 The list option `texinfo-ignore' controls which commands to ignore the
1 parameters of and the list option `texinfo-ignore-env' controls which
1 Texinfo environments to ignore.
1
1 The Texinfo filter has special code to deal with the `@table' and
1 related commands. It will apply the formatting command to each of the
1 `@item' or `@itemx' commands just like Texinfo will. This means that
1 if the formatting command is `@code' and and the `@code' command is a
1 member of the `texinfo-ignore' option than the Texinfo filter will
1 ignore the parameter of the `@item' command as if the parameter was also
1 the parameter of the `@code' command.
1
1 The Texinfo filter will also skip over the `\input texinfo' line.
1
1 4.4.1.8 Nroff Filter
1 ....................
1
1 The `nroff' filter mode allows you to check the spelling of Nroff
1 documents. The mode is enabled by giving `--add-filter=nroff' or `-n'
1 command line option to `aspell'. It is also automatically enabled if
1 the first three characters of the file being checked are `.\"' (a
1 `nroff' comment marker) or the file name ends in a one of the following
1 suffixes:
1
1 * single decimal digit from `0' to `9'
1
1 * letter `n'
1
1 * `tmac'
1
1 This filter mode skips following `nroff' language elements:
1
1 * Comments
1
1 * Requests
1
1 * Names of `nroff' registers (both traditional two-letter names and
1 GNU nroff long names)
1
1 * Arguments to the following requests: `ds', `de', `nr', `do', `so'.
1
1 * Arguments to font switch (`\f') and size switch (`\s') escapes
1
1 * Arguments to extended charset escape in both traditional (`\(')
1 and extended (`\[comp1 comp2 ...]') form.
1
1 4.4.1.9 Context Filter
1 ......................
1
1 The _context_ filter allows Aspell to distinguish between visible and
1 invisible contexts. The visible ones will be spell checked and the
1 invisible ones will be ignored. The contexts are distinguished by the
1 fact that the visible/invisible ones are delimited by specific and
1 unique delimiter characters or character sequences. Whether the
1 delimited contexts should be visible or invisible only stated by the
1 value of the `[dont-]context-visible-first' option and not by the
1 delimiters.
1
1 The context delimiters are specified as pairs of delimiters via the
1 `add|rem-context-delimiters' option. The delimiters enclosing a
1 specific context are specified as a space separated pair. If more than
1 one delimiter pair is specified by one call of
1 `add|rem-context-delimiters' they have to be combined to a comma
1 separated list. To indicate that a context is always closed by end of
1 line use `\0' sequence as closing delimiter.
1
1 4.4.1.10 Ccpp Filter Mode
1 .........................
1
1 The `ccpp' filter mode will limit spell checking to C/C++ comments and
1 string literals. Any code in between will be left alone.
1