Imported Upstream version 0.60.8
[platform/upstream/aspell.git] / manual / aspell-dev.html / Filter-Modes.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2 <html>
3 <!-- This is the developer's manual for Aspell.
4
5 Copyright © 2002, 2003, 2004, 2006 Kevin Atkinson.
6
7 Permission is granted to copy, distribute and/or modify this document
8 under the terms of the GNU Free Documentation License, Version 1.1 or
9 any later version published by the Free Software Foundation; with no
10 Invariant Sections, no Front-Cover Texts and no Back-Cover Texts.  A
11 copy of the license is included in the section entitled "GNU Free
12 Documentation License". -->
13 <!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
14 <head>
15 <title>Aspell Developer&rsquo;s Manual: Filter Modes</title>
16
17 <meta name="description" content="Aspell spell checker developer&rsquo;s manual.">
18 <meta name="keywords" content="Aspell Developer&rsquo;s Manual: Filter Modes">
19 <meta name="resource-type" content="document">
20 <meta name="distribution" content="global">
21 <meta name="Generator" content="makeinfo">
22 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
23 <link href="index.html#Top" rel="start" title="Top">
24 <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
25 <link href="index.html#Top" rel="up" title="Top">
26 <link href="Data-Structures.html#Data-Structures" rel="next" title="Data Structures">
27 <link href="Filter-Interface.html#Filter-Interface" rel="prev" title="Filter Interface">
28 <style type="text/css">
29 <!--
30 a.summary-letter {text-decoration: none}
31 blockquote.smallquotation {font-size: smaller}
32 div.display {margin-left: 3.2em}
33 div.example {margin-left: 3.2em}
34 div.indentedblock {margin-left: 3.2em}
35 div.lisp {margin-left: 3.2em}
36 div.smalldisplay {margin-left: 3.2em}
37 div.smallexample {margin-left: 3.2em}
38 div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
39 div.smalllisp {margin-left: 3.2em}
40 kbd {font-style:oblique}
41 pre.display {font-family: inherit}
42 pre.format {font-family: inherit}
43 pre.menu-comment {font-family: serif}
44 pre.menu-preformatted {font-family: serif}
45 pre.smalldisplay {font-family: inherit; font-size: smaller}
46 pre.smallexample {font-size: smaller}
47 pre.smallformat {font-family: inherit; font-size: smaller}
48 pre.smalllisp {font-size: smaller}
49 span.nocodebreak {white-space:nowrap}
50 span.nolinebreak {white-space:nowrap}
51 span.roman {font-family:serif; font-weight:normal}
52 span.sansserif {font-family:sans-serif; font-weight:normal}
53 ul.no-bullet {list-style: none}
54 table:not([class]), table:not([class]) th, table:not([class]) td {
55     padding: 2px 0.3em 2px 0.3em;
56     border: thin solid #D0D0D0;
57     border-collapse: collapse;
58 }
59
60 -->
61 </style>
62
63 <meta name=viewport content="width=device-width, initial-scale=1">
64 </head>
65
66 <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
67 <a name="Filter-Modes"></a>
68 <div class="header">
69 <p>
70 Next: <a href="Data-Structures.html#Data-Structures" accesskey="n" rel="next">Data Structures</a>, Previous: <a href="Filter-Interface.html#Filter-Interface" accesskey="p" rel="prev">Filter Interface</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
71 </div>
72 <hr>
73 <a name="Filter-Modes-1"></a>
74 <h2 class="chapter">12 Filter Modes</h2>
75
76 <p>Filter modes are the preferred way to specify combinations of
77 filters which are used regularly and thus abbreviate Aspell&rsquo;s
78 command line arguments.
79 </p>
80 <p>A new filter mode is specified by a file named like the filter
81 new mode and prefixed by <samp>.amf</samp> (Aspell Mode File). If such a file
82 is accessible by the path set via filter-path option Aspell
83 will try to load the contained mode specification.
84 </p>
85 <a name="Aspell-Mode-File"></a>
86 <h3 class="section">12.1 Aspell Mode File</h3>
87 <p>The first key in the made file has be the <code>mode</code> key.
88 It is checked against the mode name part of the .amf file.
89 If the <code>mode</code> key is missing mode file will be rejected.
90 </p>
91 <p>The same holds for the <code>aspell</code> key which specifies the
92 version(s) of Aspell which is(are) required by the filter.
93 </p>
94 <p>If these two keys are followed by at least one <code>magic</code> key
95 Aspell will be able to select the entire mode from extension and
96 if required from contents of the file to spell implicitly.
97 </p>
98 <p>The last key of the required keys is the <code>des[c[ription]]</code>
99 key. It gives a short description of the filter mode which will
100 displayed when type <code>aspell help</code>.
101 </p>
102 <p>The rest of the file consists of the keys <code>filter</code> and
103 <code>option</code> to load filters are set various options.
104 </p>
105 <a name="Version-Line"></a>
106 <h4 class="subsection">12.1.1 Version Line</h4>
107
108 <p>Each version line must start with <code>aspell</code> and be followed by a
109 version, optionally prefixed by a relational operator. The relation
110 operator can be one of &lsquo;&lt;&rsquo;, &lsquo;&lt;=&rsquo;, &lsquo;=&rsquo;, &lsquo;&gt;=&rsquo; or &rsquo;&gt;&rsquo; for allowing Aspell
111 version with version number being lower, lower or equal, equal to,
112 greater or equal or greater than required version number,
113 respectfully. If the relation operator is omitted &lsquo;=&rsquo; is assumed.
114 </p>
115 <a name="Magic-Line"></a>
116 <h4 class="subsection">12.1.2 Magic Line</h4>
117
118 <p>The magic line contains a description which requirements files
119 have to fulfill in order to implicitly activate the entire mode
120 at least one such line is required.  Each magic line has the following
121 format:
122 </p><div class="example">
123 <pre class="example">MAGIC /&lt;magic key&gt;/&lt;fileextension&gt;[/&lt;fileextension&gt;]
124 </pre></div>
125
126 <p>The magic key consist of three &lsquo;:&rsquo; separated fields.
127 The first two are byte counts the last is a regular expression.
128 The first byte count indicates the first byte the regular expression
129 will be applied to the second byte count indicates the number of
130 bytes to test against the regular expression.
131 </p>
132 <p>If mode selection should only occurred on basis of the listed file
133 extensions the magic key should consist of the &ldquo;&lt;noregex&gt;&rdquo; special
134 string.
135 </p>
136 <p>At least one &lt;fileextension&gt; is required per MAGIC line.
137 &lt;fileextension&gt; may not be empty and should not contain a leading &lsquo;.&rsquo;
138 as this is assumed implicitly.
139 </p>
140 <p>Multiple MAGIC lines are allowed. Modes may be extended limited by additional
141 &lt;label&gt;.amf files located in &ndash;filter-path
142 Thus file extensions may be prefixed by &lsquo;+&rsquo; or &lsquo;-&rsquo; to indicate that
143 the entire extension has to be added ore removed from this &lt;magic key&gt;
144 if neither is specified than a &lsquo;+&rsquo; is assumed implicitly.
145 </p>
146 <a name="Description-Line"></a>
147 <h4 class="subsection">12.1.3 Description Line</h4>
148
149 <p>The required description line will be printed when typing
150 <code>aspell help</code>.  Keep it as short as possible.  Possible
151 abbreviations are <code>des</code> and <code>desc</code>.
152 </p>
153 <a name="Filter-and-Option-Lines"></a>
154 <h4 class="subsection">12.1.4 Filter and Option Lines</h4>
155
156 <p>The <code>filter</code> and <code>option</code> keys load filters and set filter
157 options.
158 </p>
159 <p>The value of the <code>filter</code> key is equal to the value of Aspell&rsquo;s
160 <code>[add|rem]-filter</code> option. 
161 </p>
162 <p>Each <code>option</code> line has the following format:
163 </p>
164 <div class="example">
165 <pre class="example">  OPTION &lt;option&gt; [&lt;value&gt;]
166 </pre></div>
167
168 <p>The format of the &lt;option&gt; and &lt;value&gt; is the same format as 
169 found in the Aspell configuration file.
170 </p>
171
172
173
174 <hr>
175 <div class="header">
176 <p>
177 Next: <a href="Data-Structures.html#Data-Structures" accesskey="n" rel="next">Data Structures</a>, Previous: <a href="Filter-Interface.html#Filter-Interface" accesskey="p" rel="prev">Filter Interface</a>, Up: <a href="index.html#Top" accesskey="u" rel="up">Top</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>]</p>
178 </div>
179
180
181
182 </body>
183 </html>