-->
Page 1089
For example, the condition . means "any word", and the condition Y means "any word ending in Y." The following (suffix) replacements:
. > MENT Y > -Y,IES
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.)
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:
[EY] > -[EY],IES
This will not work. Instead, you must use two separate rules:
E > -E,IES Y > -Y,IES
The application of repls can be restricted to certain words with conditions:
condition : { . | character | range }
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
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.
Conditions that are single characters should be separated by whitespace. For example, to specify words ending in ED, write this:
E D> -ED,ING # As in covered > covering
If you write this:
ED > -ED,ING
the effect will be the same as
[ED] > -ED,ING
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:
$ munchlist -c oldaffixes -l newaffixes olddict > newdict
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.)
EXAMPLES
As an example of conditional suffixes, here is the specification of the S flag from the English affix file:
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
Page 1090
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.
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."
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:
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
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.
SEE ALSO
ispell(1)
Local
lpLine printer devices.
Synopsis
#include <linux/lp.h>
CONFIGURATION
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.
DESCRIPTION
The following ioctl(2) calls are supported:
int ioctl(int fd, LPTIME, int arg) | 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. |
int ioctl(int fd, LPCHAR, int arg) | 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. |