📄 1089-1090.html
字号:
<HTML>
<HEAD>
<TITLE>Linux Complete Command Reference:Special Files:EarthWeb Inc.-</TITLE>
</HEAD>
<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=0672311046 //-->
<!-- TITLE=Linux Complete Command Reference//-->
<!-- AUTHOR=Red Hat//-->
<!-- PUBLISHER=Macmillan Computer Publishing//-->
<!-- IMPRINT=Sams//-->
<!-- CHAPTER=04 //-->
<!-- PAGES=1063-1102 //-->
<!-- UNASSIGNED1 //-->
<!-- UNASSIGNED2 //-->
<P><CENTER>
<a href="1088-1088.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="1091-1093.html">Next</A></CENTER></P>
<A NAME="PAGENUM-1089"><P>Page 1089</P></A>
<P>For example, the condition . means "any word", and the
condition Y means "any word ending in Y." The following
(suffix) replacements:
</P>
<!-- CODE SNIP //-->
<PRE>
. > MENT
Y > -Y,IES
</PRE>
<!-- END CODE SNIP //-->
<P>would change induce to inducement and fly to
flies. (If they were controlled by the same flag, they would also change
fly to flyment, which might not be what was wanted.
munchlist can be used to protect against this sort of problem; see
the command sequence given in the next paragraph.)
</P>
<P>No matter how much you might want it, the strings on the right must be strings of specific characters, not ranges.
The reasons are rooted deeply in the way ispell works, and it would be difficult or impossible to provide for more flexibility.
For example, you might want to write:
</P>
<!-- CODE SNIP //-->
<PRE>
[EY] > -[EY],IES
</PRE>
<!-- END CODE SNIP //-->
<P>This will not work. Instead, you must use two separate rules:
</P>
<!-- CODE SNIP //-->
<PRE>
E > -E,IES
Y > -Y,IES
</PRE>
<!-- END CODE SNIP //-->
<P>The application of repls can be restricted to certain words with conditions:
</P>
<!-- CODE SNIP //-->
<PRE>
condition : { . | character | range }
</PRE>
<!-- END CODE SNIP //-->
<P>A condition is a restriction on the characters that adjoin, and/or are replaced by, the right-hand side of the
repl. Up to
eight conditions may be given, which should be enough context for anyone. The right-hand side will be applied only <BR>
if the conditions in the repl are satisfied. The conditions also implicitly define a length; roots shorter than the number
of conditions will not pass the test. (As a special case, a condition of a single dot defines a length of zero, so that the rule
applies to all words indiscriminately.) This length is independent of the separate test that insists that all flags produce an
output word length of at least four.
</P>
<P>Conditions that are single characters should be separated by whitespace. For example, to specify words ending in
ED, write this:
</P>
<!-- CODE SNIP //-->
<PRE>
E D> -ED,ING # As in covered > covering
</PRE>
<!-- END CODE SNIP //-->
<P>If you write this:
</P>
<!-- CODE SNIP //-->
<PRE>
ED > -ED,ING
</PRE>
<!-- END CODE SNIP //-->
<P>the effect will be the same as
</P>
<!-- CODE SNIP //-->
<PRE>
[ED] > -ED,ING
</PRE>
<!-- END CODE SNIP //-->
<P>As a final, minor but important point, it is sometimes useful to rebuild a dictionary file using an incompatible suffix file.
For example, suppose you expand the R flag to generate "er" and "ers" (thus making the
Z flag somewhat obsolete). To build a new dictionary
newdict that using new affixes will accept exactly the same list of words as the old list
olddict did using old affixes, the _c switch of
munchlist is useful, as in the following example:
</P>
<!-- CODE SNIP //-->
<PRE>
$ munchlist -c oldaffixes -l newaffixes olddict > newdict
</PRE>
<!-- END CODE SNIP //-->
<P>If you use this procedure, your new dictionary will always accept the same list the original did, even if you badly screwed
up the affix file. This is because munchlist compares the words generated by a flag with the original word list and refuses to
use any flags that generate illegal words. (Don't forget that the
munchlist step takes a long time and eats up temporary file space.)
</P>
<P><B>
EXAMPLES
</B></P>
<P>As an example of conditional suffixes, here is the specification of the
S flag from the English affix file:
</P>
<!-- CODE //-->
<PRE>
flag *S:
[^AEIOU]Y > -Y,IES # As in imply > implies
[AEIOU]Y > S # As in convey > conveys
[SXZH] > ES # As in fix > fixes
[^SXZHY] > S #As in bat > bats
</PRE>
<!-- END CODE //-->
<A NAME="PAGENUM-1090"><P>Page 1090</P></A>
<P>The first line applies to words ending in Y but not in vowel-Y. The second takes care of the vowel-Y words. The third
then handles those words that end in a sibilant or near-sibilant, and the last picks up everything else.
</P>
<P>Note that the conditions are written very carefully so that they apply to disjoint sets of words. In particular, note that
the fourth line excludes words ending in Y as well as the obvious SXZH. Otherwise, it would convert "imply" into "implys."
</P>
<P>Although the English affix file does not do so, you can also have a flag generate more than one variation on a root word.
For example, you could extend the English R flag as follows:
</P>
<!-- CODE //-->
<PRE>
flag *R:
E > R #As in skate > skater
E > RS # As in skate > skaters
[^AEIOU]Y > -Y,IER # As in multiply > multiplier
[^AEIOU]Y > -Y,IERS # As in multiply > multipliers
[AEIOU]Y > ER # As in convey > conveyer
[AEIOU]Y > ERS # As in convey > conveyers
[^EY] > ER # As in build > builder
[^EY] > ERS # As in build > builders
</PRE>
<!-- END CODE //-->
<P>This flag would generate both "skater" and "skaters" from "skate." This capability can be very useful in languages that
make use of noun, verb, and adjective endings. For instance, one could define a single flag that generated all the German
"weak" verb endings.
</P>
<P><B>
SEE ALSO
</B></P>
<!-- CODE SNIP //-->
<PRE>
ispell(1)
</PRE>
<!-- END CODE SNIP //-->
<P>Local
</P>
<H3><A NAME="ch04_ 9">
lp
</A></H3>
<!-- CODE SNIP //-->
<PRE>
lp—Line printer devices.
</PRE>
<!-- END CODE SNIP //-->
<P><B>
Synopsis
</B></P>
<!-- CODE SNIP //-->
<PRE>
#include <linux/lp.h>
</PRE>
<!-- END CODE SNIP //-->
<P><B>
CONFIGURATION
</B></P>
<P>lp[02] are character devices for the parallel line printers; they have major number 6 and minor number 02. The
minor numbers correspond to the printer port base addresses 0x03bc, 0x0378, and 0x0278. Usually, they have mode 220 and
are owned by root and group lp. You can use printer ports either with polling or with interrupts. Interrupts are
recommended when high traffic is expected, such as for laser printers. For usual dot matrix printers, polling will usually be enough.
The default is polling.
</P>
<P><B>
DESCRIPTION
</B></P>
<P>The following ioctl(2) calls are supported:
</P>
<TABLE>
<TR><TD>
int ioctl(int fd, LPTIME, int arg)
</TD><TD>
Sets the amount of time that the driver sleeps before rechecking
the printer when the printer's buffer appears to be filled to
arg. If you have a fast printer, decrease this number; if you have a slow printer,
then increase it. This is in hundredths of a second; the default
2 is 0.05 seconds. It only influences the polling driver.
</TD></TR><TR><TD>
int ioctl(int fd, LPCHAR, int arg)
</TD><TD>
Sets the maximum number of busy-wait iterations that the polling
driver does while waiting for the printer to get ready for receiving a character
to arg. If printing is too slow, increase this number; if the system gets
too slow, decrease this number. The default is 1000. It only influences
the polling driver.
</TD></TR></TABLE>
<P><CENTER>
<a href="1088-1088.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="1091-1093.html">Next</A></CENTER></P>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -