469c23d92681c62d44de018000e0f9beecc642c3
[platform/upstream/aspell.git] / manual / aspell.html / Through-A-Pipe.html
1 <html lang="en">
2 <head>
3 <title>Through A Pipe - GNU Aspell 0.60.6.1</title>
4 <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
5 <meta name="description" content="Aspell 0.60.6.1 spell checker user's manual.">
6 <meta name="generator" content="makeinfo 4.8">
7 <link title="Top" rel="start" href="index.html#Top">
8 <link rel="up" href="Writing-programs-to-use-Aspell.html#Writing-programs-to-use-Aspell" title="Writing programs to use Aspell">
9 <link rel="prev" href="Through-the-C-API.html#Through-the-C-API" title="Through the C API">
10 <link rel="next" href="Notes-on-Storing-Replacement-Pairs.html#Notes-on-Storing-Replacement-Pairs" title="Notes on Storing Replacement Pairs">
11 <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
12 <!--
13 This is the user's manual for Aspell
14
15 GNU Aspell is a spell checker designed to eventually replace Ispell.
16 It can either be used as a library or as an independent spell checker.
17
18 Copyright (C) 2000--2011 Kevin Atkinson.
19
20      Permission is granted to copy, distribute and/or modify this
21      document under the terms of the GNU Free Documentation License,
22      Version 1.1 or any later version published by the Free Software
23      Foundation; with no Invariant Sections, no Front-Cover Texts and
24      no Back-Cover Texts.  A copy of the license is included in the
25      section entitled "GNU Free Documentation License".
26    -->
27 <meta http-equiv="Content-Style-Type" content="text/css">
28 <style type="text/css"><!--
29   pre.display { font-family:inherit }
30   pre.format  { font-family:inherit }
31   pre.smalldisplay { font-family:inherit; font-size:smaller }
32   pre.smallformat  { font-family:inherit; font-size:smaller }
33   pre.smallexample { font-size:smaller }
34   pre.smalllisp    { font-size:smaller }
35   span.sc    { font-variant:small-caps }
36   span.roman { font-family:serif; font-weight:normal; } 
37   span.sansserif { font-family:sans-serif; font-weight:normal; } 
38 --></style>
39 </head>
40 <body>
41 <div class="node">
42 <p>
43 <a name="Through-A-Pipe"></a>
44 Next:&nbsp;<a rel="next" accesskey="n" href="Notes-on-Storing-Replacement-Pairs.html#Notes-on-Storing-Replacement-Pairs">Notes on Storing Replacement Pairs</a>,
45 Previous:&nbsp;<a rel="previous" accesskey="p" href="Through-the-C-API.html#Through-the-C-API">Through the C API</a>,
46 Up:&nbsp;<a rel="up" accesskey="u" href="Writing-programs-to-use-Aspell.html#Writing-programs-to-use-Aspell">Writing programs to use Aspell</a>
47 <hr>
48 </div>
49
50 <h3 class="section">6.2 Through A Pipe</h3>
51
52 <p>When given the <samp><span class="command">pipe</span></samp> or <samp><span class="command">-a</span></samp> command, Aspell goes
53 into a pipe mode that is compatible with <samp><span class="command">ispell -a</span></samp>.  Aspell
54 also defines its own set of extensions to Ispell pipe mode.
55
56 <h4 class="subsection">6.2.1 Format of the Data Stream</h4>
57
58 <p>In this mode, Aspell prints a one-line version identification message,
59 and then begins reading lines of input.  For each input line, a single
60 line is written to the standard output for each word checked for
61 spelling on the line.  If the word was found in the main dictionary,
62 or your personal dictionary, then the line contains only a `<samp><span class="samp">*</span></samp>'.
63
64    <p>If the word is not in the dictionary, but there are suggestions, then
65 the line contains an `<samp><span class="samp">&amp;</span></samp>', a space, the misspelled word, a space,
66 the number of near misses, the number of characters between the
67 beginning of the line and the beginning of the misspelled word, a
68 colon, another space, and a list of the suggestions separated by
69 commas and spaces.
70
71    <p>If you set the option <samp><span class="command">run-together</span></samp> and Aspell thinks this word
72 is a combination of two words in the dictionary, then it prints a single
73 `<samp><span class="samp">-</span></samp>' in one line.
74
75    <p>Finally, if the word does not appear in the dictionary, and there are
76 no suggestions, then the line contains a `<samp><span class="samp">#</span></samp>', a space, the
77 misspelled word, a space, and the character offset from the beginning
78 of the line.  Each sentence of text input is terminated with an
79 additional blank line, indicating that Aspell has completed processing
80 the input line.
81
82    <p>These output lines can be summarized as follows:
83
84 <pre class="example">     <strong>OK</strong>: *
85      <strong>Suggestions</strong>: &amp; <i>original</i> <i>count</i> <i>offset</i>: <i>miss</i>, <i>miss</i>, ...
86      <strong>None</strong>: # <i>original</i> <i>offset</i>
87 </pre>
88    <p>When in the <samp><span class="option">-a</span></samp> mode, Aspell will also accept lines of single
89 words prefixed with any of `<samp><span class="samp">*</span></samp>', `<samp><span class="samp">&amp;</span></samp>', `<samp><span class="samp">@</span></samp>',
90 `<samp><span class="samp">+</span></samp>', `<samp><span class="samp">-</span></samp>', `<samp><span class="samp">~</span></samp>', `<samp><span class="samp">#</span></samp>', `<samp><span class="samp">!</span></samp>', `<samp><span class="samp">%</span></samp>', or
91 `<samp><span class="samp">^</span></samp>'.  A line starting with `<samp><span class="samp">*</span></samp>' tells Aspell to insert the
92 word into the user's dictionary.  A line starting with `<samp><span class="samp">&amp;</span></samp>' tells
93 Aspell to insert an all-lowercase version of the word into the user's
94 dictionary.  A line starting with `<samp><span class="samp">@</span></samp>' causes Aspell to accept
95 this word in the future.  A line starting with `<samp><span class="samp">+</span></samp>', followed
96 immediately by a valid mode will cause Aspell to parse future input
97 according the syntax of that formatter.  A line consisting solely of a
98 `<samp><span class="samp">+</span></samp>' will place Aspell in TeX/LaTeX mode (similar to the
99 <samp><span class="option">-t</span></samp> option) and `<samp><span class="samp">-</span></samp>' returns Aspell to its default mode
100 (which is Nroff unless otherwise specified). 
101 (but these commands are obsolete).  A line `<samp><span class="samp">~</span></samp>', is ignored for
102 Ispell compatibility.  A line prefixed with `<samp><span class="samp">#</span></samp>' will cause the
103 personal dictionaries to be saved.  A line prefixed with `<samp><span class="samp">!</span></samp>'
104 will turn on terse mode (see below), and a line prefixed with
105 `<samp><span class="samp">%</span></samp>' will return Aspell to normal (non-terse) mode.  Any input
106 following the prefix characters `<samp><span class="samp">+</span></samp>', `<samp><span class="samp">-</span></samp>', `<samp><span class="samp">#</span></samp>',
107 `<samp><span class="samp">!</span></samp>', `<samp><span class="samp">~</span></samp>', or `<samp><span class="samp">%</span></samp>' is ignored, as is any input
108 following.  To allow spell-checking of lines beginning with these
109 characters, a line starting with `<samp><span class="samp">^</span></samp>' has that character removed
110 before it is passed to the spell-checking code.  It is recommended
111 that programmatic interfaces prefix every data line with an uparrow to
112 protect themselves against future changes in Aspell.
113
114    <p>To summarize these:
115
116    <p><table summary=""><tr align="left"><td valign="top" width="10%"><kbd>*</kbd><var>word</var>
117  </td><td valign="top" width="90%">Add a word to the personal dictionary
118 <br></td></tr><tr align="left"><td valign="top" width="10%"><kbd>&amp;</kbd><var>word</var>
119  </td><td valign="top" width="90%">Insert the all-lowercase version of the word in the personal dictionary
120 <br></td></tr><tr align="left"><td valign="top" width="10%"><kbd>@</kbd><var>word</var>
121  </td><td valign="top" width="90%">Accept the word, but leave it out of the dictionary
122 <br></td></tr><tr align="left"><td valign="top" width="10%"><kbd>#</kbd>
123  </td><td valign="top" width="90%">Save the current personal dictionary
124 <br></td></tr><tr align="left"><td valign="top" width="10%"><kbd>~</kbd> </td><td valign="top" width="90%">Ignored for Ispell compatibility. 
125 <br></td></tr><tr align="left"><td valign="top" width="10%"><kbd>+</kbd> </td><td valign="top" width="90%">Enter TeX mode. 
126 <br></td></tr><tr align="left"><td valign="top" width="10%"><kbd>+</kbd><var>mode</var> </td><td valign="top" width="90%">Enter the mode specified by <var>mode</var>. 
127 <br></td></tr><tr align="left"><td valign="top" width="10%"><kbd>-</kbd> </td><td valign="top" width="90%">Enter the default mode. 
128 <br></td></tr><tr align="left"><td valign="top" width="10%"><kbd>!</kbd> </td><td valign="top" width="90%">Enter terse mode
129 <br></td></tr><tr align="left"><td valign="top" width="10%"><kbd>%</kbd> </td><td valign="top" width="90%">Exit terse mode
130 <br></td></tr><tr align="left"><td valign="top" width="10%"><kbd>^</kbd> </td><td valign="top" width="90%">Spell-check the rest of the line
131    <br></td></tr></table>
132
133    <p>In terse mode, Aspell will not print lines beginning with `<samp><span class="samp">*</span></samp>',
134 which indicate correct words.  This significantly improves running
135 speed when the driving program is going to ignore correct words
136 anyway.
137
138    <p>In addition to the above commands which are designed for Ispell
139 compatibility Aspell also supports its own extensions.  All Aspell
140 extensions follow the following format.
141
142 <pre class="example">     $$<var>command</var> [<var>data</var>]
143 </pre>
144    <p>Where <var>data</var> may or may not be required depending on the
145 particular command.  Aspell currently supports the following commands:
146
147    <p><table summary=""><tr align="left"><td valign="top" width="33%"><code>cs </code><var>option</var><code>,</code><var>value</var> </td><td valign="top" width="67%">Change a configuration option. 
148 <br></td></tr><tr align="left"><td valign="top" width="33%"><code>cr </code><var>option</var> </td><td valign="top" width="67%">Prints the value of a configuration option. 
149 <br></td></tr><tr align="left"><td valign="top" width="33%"><code>pp</code>
150  </td><td valign="top" width="67%">Returns a list of all words in the current personal wordlist. 
151 <br></td></tr><tr align="left"><td valign="top" width="33%"><code>ps</code>
152  </td><td valign="top" width="67%">Returns a list of all words in the current session dictionary. 
153 <br></td></tr><tr align="left"><td valign="top" width="33%"><code>l</code> </td><td valign="top" width="67%">Returns the current language name. 
154 <br></td></tr><tr align="left"><td valign="top" width="33%"><code>ra </code><var>mis</var><code>,</code><var>cor</var> </td><td valign="top" width="67%">Add the word pair to the
155  replacement dictionary for later use. Returns nothing.
156    <br></td></tr></table>
157
158    <p>Anything returned is returned on its own line.  All lists returned
159 have the following format
160
161 <pre class="example">     <i>num of items</i>: <i>item1</i>, <i>item2</i>, <i>etc</i>
162 </pre>
163    <!-- FIXME: Add note about byte-offset option. -->
164 <p><em>(Part of the preceding section was directly copied out of the
165 Ispell manual)</em>
166
167    </body></html>
168