📄 1088-1088.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="1086-1087.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="1089-1090.html">Next</A></CENTER></P>
<A NAME="PAGENUM-1088"><P>Page 1088</P></A>
<P>A single character-set statement can declare either a single character or a contiguous range of characters. A range is given as
in egrep and the shell: [a-z] means lowercase alphabetics;
[^a-z] means all but lowercase, and so on. All character-set
statements are combined (unioned) to produce the final list of characters that may be part of a word. The collating order of
the characters is defined by the order of their declaration; if a range is used, the characters are considered to have been declared
in ASCII order. Characters that have case are collated next to each other, with the uppercase character first.
</P>
<P>The character-declaration statements have a rather strange behavior caused by the need to match each lowercase
character with its uppercase equivalent. In any given
wordchars or boundarychars statement, the characters in each range are first
sorted into ASCII collating sequence, then matched one-for-one with the other range. (The two ranges must have the same
number of characters). Thus, for example, the two statements:
</P>
<!-- CODE SNIP //-->
<PRE>
wordchars [aeiou] [AEIOU]
wordchars [aeiou] [UOIEA]
</PRE>
<!-- END CODE SNIP //-->
<P>would produce exactly the same effect. To get the vowels to match up "wrong," you would have to use separate statements:
</P>
<!-- CODE SNIP //-->
<PRE>
wordchars a U
wordchars e O
wordchars i I
wordchars o E
wordchars u A
</PRE>
<!-- END CODE SNIP //-->
<P>which would cause uppercase e to be O, and lowercase
0 to be e. This should normally be a problem only with languages
that have been forced to use a strange ASCII collating sequence. If your uppercase and lowercase letters both collate in the
same order, you shouldn't have to worry about this "feature."
</P>
<P>The prefixes and suffixes sections have exactly the same syntax, except for the introductory keyword:
</P>
<!-- CODE SNIP //-->
<PRE>
prefixes : prefixes flagdef*
suffixes : suffixes flagdef*
flagdef : flag [*jÚ] char : repl *
</PRE>
<!-- END CODE SNIP //-->
<P>A prefix or suffix table consists of an introductory keyword and a list of flag definitions. Flags can be defined more than
once, in which case the definitions are combined. Each flag controls one or more
repls (replacements), which are conditionally applied to the beginnings or endings of various words.
</P>
<P>Flags are named by a single character char. Depending on a configuration option, this character can be either any
uppercase letter (the default configuration) or any 7-bit ASCII character. Most languages should be able to get along with just 26 flags.
</P>
<P>A flag character may be prefixed with one or more option characters. (If you wish to use one of the option characters as a
flag character, simply enclose it in double quotes.)
</P>
<P>The asterisk (*) option means that this flag participates in cross-product formation. This only matters if the file contains
both prefix and suffix tables. If so, all prefixes and suffixes marked with an asterisk will be applied in all cross-combinations to
the root word. For example, consider the root fix with prefixes
pre and in, and suffixes es and ed. If all flags controlling
these prefixes and suffixes are marked with an asterisk, then the single root
fix would also generate prefix, prefixes, prefixed,
infix, infixes, infixed, fix, fixes, and fixed. Cross-product formation can produce a large number of words quickly, some of
which may be illegal, so watch out. If cross-products produce illegal words,
munchlist will not produce those flag combinations,
and the flag will not be useful.
</P>
<!-- CODE SNIP //-->
<PRE>
repl : condition* > [ - strip-string , ] append-string
</PRE>
<!-- END CODE SNIP //-->
<P>The ~ option specifies that the associated flag is only active when a compound word is being formed. This is useful in
a language like German, in which the form of a word sometimes changes inside a compound.
</P>
<P>A repl is a conditional rule for modifying a root word. Up to eight conditions may be specified. If the conditions
are satisfied, the rules on the rightside of the
repl are applied, as follows:
</P>
<OL>
<LI> If a strip-string is given, it is first stripped from the beginning or ending (as appropriate) of the root word.
<LI> The append-string is added at that point.
</OL>
<P><CENTER>
<a href="1086-1087.html">Previous</A> | <a href="../ewtoc.html">Table of Contents</A> | <a href="1089-1090.html">Next</A></CENTER></P>
</td>
</tr>
</table>
<!-- begin footer information -->
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -