⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 0227-0228.html

📁 linux-unix130.linux.and.unix.ebooks130 linux and unix ebookslinuxLearning Linux - Collection of 12 E
💻 HTML
字号:




<HTML>

<HEAD>

<TITLE>Sams Teach Yourself Linux in 24 Hours:Text Processing:EarthWeb Inc.-</TITLE>

<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">
<SCRIPT>
<!--
function displayWindow(url, width, height) {
        var Win = window.open(url,"displayWindow",'width=' + width +
',height=' + height + ',resizable=1,scrollbars=yes');
}
//-->
</SCRIPT>
</HEAD>

 -->




<!-- ISBN=0672311623 //-->

<!-- TITLE=Sams Teach Yourself Linux in 24 Hours//-->

<!-- AUTHOR=Bill Ball//-->

<!-- PUBLISHER=Macmillan Computer Publishing//-->

<!-- IMPRINT=Sams//-->

<!-- CHAPTER=14 //-->

<!-- PAGES=0211-0228 //-->

<!-- UNASSIGNED1 //-->

<!-- UNASSIGNED2 //-->













<P><CENTER>

<a href="0224-0226.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="../ch15/0229-0232.html">Next</A>

</CENTER></P>



<A NAME="PAGENUM-227"><P>Page 227</P></A>





<P>Note that the &lt; redirection operator has been used because in the

-l mode, the ispell command acts as a spelling filter, checking the input text stream against its

dictionary (located under the /usr/lib/ispell directory). You can-redirect this list to a file, or use

ispell's -f command-line option:

</P>



<!-- CODE SNIP //-->

<PRE>

# ispell -l -f errors -a &lt;LICENSE

</PRE>

<!-- END CODE SNIP //-->



<P>This sends all misspelled words to the file called

errors. The ispell program has 15 different command-line options. Use the

-L option to change the amount of context, or text

displayed before and after a suspected error. The

-b option creates a backup file of your original document, which is a good idea if you make a mistake and enter a wrong correction

(this is the default for your version of ispell).

</P>



<P>The ispell package includes nine other programs you can use to build your

own dictionaries, or add lists of words from your personal dictionary into ispell's

dictionaries. For details about these programs, see the ispell manual page. For details about

building your own dictionaries, read the ispell manual page under the

/usr/man/man4 directory. You can do this with the following command:

</P>



<!-- CODE SNIP //-->

<PRE>

# man 4 ispell

</PRE>

<!-- END CODE SNIP //-->



<P>Documentation for ispell is in its two manual pages and under the

/usr/doc directory.

</P>



<H4><A NAME="ch14_ 14">

Single Word Lookup and Other Tricks

</A></H4>



<P>When all you need is quick confirmation of the spelling of a single word, you don't

have to run your word processor or text editor to get the answer, because you can use the

look command, found under the /usr/bin/directory.

</P>



<P>Although the look command is normally used to search files and print all lines matching

a given string pattern, the look command quickly looks up a word in the system

dictionary. If you don't specify a file to search on the

look command line, look automatically searches the system dictionary, called words, which is located in the

/usr/dict directory. See the following example:

</P>



<!-- CODE //-->

<PRE>

# look consci

conscience

consciences

conscientious

conscientiously

conscious

consciously

consciousness

</PRE>

<!-- END CODE //-->



<TABLE BGCOLOR=#FFFF99><TR><TD>JUST A MINUTE</TD></TR><TR><TD>

<BLOCKQUOTE>

The system dictionary, words, is a symbolic link to the file called

linux.words, also located in the /usr/dict directory. This dictionary, a 400,000-character,

plain

</BLOCKQUOTE></TD></TR></TABLE>







<A NAME="PAGENUM-228"><P>Page 228</P></A>







<TABLE BGCOLOR=#FFFF99><TR><TD></TD></TR><TR><TD>

<BLOCKQUOTE>

ASCII list of sorted words, contains 45,402 words. You can find an even

larger dictionary, called web2, which is more than two megabytes, and contains

more than 100,000 words, by searching your favorite Linux Internet sites

(try sunsite.unc.edu).

</BLOCKQUOTE></TD></TR></TABLE>



<P>All you have to do is type several characters of the beginning of a word and the

look command prints any matches found in the system dictionary. You also can use the ispell command's

-a command-line option to check spelling interactively, or quickly look up a single

word, or several words at the keyboard. Lookups are performed on ispell's dictionary, not

the system dictionary. See the following example:

</P>



<!-- CODE //-->

<PRE>

# ispell -a

@(#) International Ispell Version 3.1.20 10/10/95

seperate

&amp; seperate 1 0: separate



mispell

&amp; mispell 3 0: dispell, ispell, misspell



mississippi

&amp; mississippi 1 0: Mississippi



truncate

*

[Ctrl-d]

#

</PRE>

<!-- END CODE //-->



<P>Notice that ispell starts, prints a short version message, and then waits for your input.

When you enter a misspelled word, ispell echoes the word back,

and if a suggested replacement is found, prints the replacement with a number. Also note that ispell even corrects

words spelled correctly, but not properly capitalized. Finally, if you enter a correct word,

ispell merely echoes back an asterisk. To quit, enter an end of text character by holding

down the Ctrl key and pressing d.

</P>



<P><CENTER>

<a href="0224-0226.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="../ch15/0229-0232.html">Next</A>

</CENTER></P>











</td>
</tr>
</table>

<!-- begin footer information -->









</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -