home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: Product / Product.zip / ISPSRC.ZIP / english.aff < prev    next >
Text File  |  1992-08-14  |  17KB  |  429 lines

  1. #
  2. # $Id: english.aff,v 1.11 91/09/12 00:01:33 geoff Exp $
  3. #
  4. # Copyright 1987, 1988, 1989, by Geoff Kuenning, Manhattan Beach, CA
  5. # Permission for non-profit use is hereby granted.
  6. # All other rights reserved.
  7. # See "version.h" for a more complete copyright notice.
  8. #
  9. # $Log:    english.aff,v $
  10. # Revision 1.11  91/09/12  00:01:33  geoff
  11. # Fix the definition of "texchars" to reflect the new requirements, and
  12. # fix the comments describing that statement.
  13. # Revision 1.10  91/09/04  18:00:46  geoff
  14. # Fix a tiny typo.
  15. # Revision 1.9  91/05/27  21:35:12  geoff
  16. # Move the nroffchars and texchars statements to conform with the new
  17. # statement ordering restrictions.
  18. # Revision 1.8  89/04/30  17:50:31  geoff
  19. # Rewrite the comments (and the character-set declarations) to describe and
  20. # conform to the new yacc grammar.
  21. # Revision 1.7  89/02/18  00:51:23  geoff
  22. # Add definitions of "nroffchars" and "texchars", primarily to server as
  23. # an example.  (Ken Stevens)
  24. # Revision 1.6  88/12/26  02:24:03  geoff
  25. # Update the copyright notice.
  26. # Revision 1.5  88/02/20  23:10:19  geoff
  27. # Add comments about what flags are within use. Fix a cosmetic case error.
  28. # Revision 1.4  87/09/14  22:38:13  geoff
  29. # Add copyright comments
  30. # Revision 1.3  87/09/09  00:16:17  geoff
  31. # Add comments about how charset statements now control collating order.
  32. # Revision 1.2  87/08/02  17:17:03  geoff
  33. # Add three prefixes (A: re, I: in, and U: un), cross-product flags, and
  34. # extensive commentary roughly documenting the table format, in case this
  35. # file gets distributed by itself.
  36. # Revision 1.1  87/06/28  23:13:54  geoff
  37. # Initial revision
  38. #
  39. #    Affix table for English
  40. #
  41. # Brief description of table syntax (* in syntax descriptions means one
  42. # or more occurrences;  square brackets and braces have their usual meaning):
  43. #
  44. # Although the grammar is designed for a line-oriented layout, it is actually
  45. # a free-format yacc grammar and can be laid out weirdly if you want.
  46. # Comments are started by "#" and continue to the end of the line.
  47. # Backslashes are supported in the usual fashion (\nnn, plus specials
  48. # \n, \r, \t, \v, \f, \b, and the new hex format \xnn).  Any character
  49. # with special meaning to the parser can be changed to an uninterpreted
  50. # token by backslashing it;  for example you can declare a flag named
  51. # 'asterisk' or 'colon' with "flag \*:" or "flag \::".
  52. #
  53. # table        :    [headers]  [prefixes] [suffixes]
  54. #
  55. # One of "prefixes" and "suffixes" is required.  They can appear in either
  56. # order.
  57. #
  58. # headers    :    {options | char-sets }* 
  59. #
  60. # The headers contain global descriptions and options.  These are used to
  61. # describe the character sets used by the language, the characters that have
  62. # special meaning to the formatter, and the defaults for certain ispell
  63. # options.
  64. #
  65. # options    :    { fmtr-stmt | bool-stmt | flag-stmt }
  66. #
  67. # fmtr-stmt    :    { nroff-stmt | tex-stmt }
  68. #
  69. # A fmtr-stmt describes characters that have special meaning to a formatter.
  70. # Normally, this statement is not necessary, but some languages may have
  71. # preempted the usual defaults for use as language-specific characters.  In
  72. # this case, these statements may be used to redefine the special characters
  73. # expected by the formatter.
  74. #
  75. # nroff-stmt    :    "nroffchars" string
  76. #
  77. # The nroff-stmt describes the characters that have special meaning to the
  78. # nroff/troff family of formatters.  A string of exactly five characters must
  79. # be given.  The default string is "().\*" and refers to the meanings of those
  80. # five characters in an unmodified nroff.  In other words, the backslash is
  81. # used to introduce special formatter sequences, the asterisk is used to
  82. # introduce string substitutions, the left parenthesis is used after a backslash
  83. # to introduce two-character symbol names, and the period is used at the
  84. # beginning of a line to introduce formatter commands.  (The right parenthesis
  85. # is not currently used, but is included for completeness.)
  86. #
  87. # tex-stmt    :    "texchars" string
  88. #
  89. # The tex-stmt is similarly used to describe characters that have special
  90. # meaning to the TeX and LaTeX formatters.  A string of exactly 13 characters
  91. # must be given.  The default string is "()[]{}<>\$*.%" and refers to the
  92. # meanings of those characters in an unmodified TeX processor.  (The
  93. # dot, square brackets, and angle brackets also apply to the "tib"
  94. # bibliographic processor.)
  95. #
  96. # bool-stmt    :    { "compoundwords" on-or-off | "allaffixes" on-or-off }
  97. #
  98. # on-or-off    :    { "on" | "off" }
  99. #
  100. # A bool-stmt controls certain ispell defaults that are best made
  101. # language-specific.  The "compoundwords" statement controls the default
  102. # for the "-B" and "-C" options, which control whether run-together words
  103. # are acceptable spellings.  "Compoundwords" should usually be turned on
  104. # for languages such as German, where legal words may be formed from the
  105. # concatenation of shorter words.  The default is "off".
  106. #
  107. # The "allaffixes" statement controls the default for the "-P" and "-m"
  108. # options, which control whether ispell will suggest possible
  109. # affix derivations for misspelled words even if possible corrections
  110. # are found in the dictionary.  This option should usually be turned on
  111. # when you are developing the dictionary for a language, and off for
  112. # languages that have fairly complete dictionaries.  The default is "off".
  113. #
  114. # flag-stmt    :    "flagmarker" character
  115. #
  116. # The flag-stmt describes the character which is used to separate affix
  117. # flags from the root word in a raw dictionary file.  This must be a
  118. # character which is not found in any word (including in string characters;
  119. # see below).  The default is "/" because this character is not normally
  120. # used to represent special characters in any language.
  121. #
  122. # char-sets    :    { char-stmt | string-stmt }
  123. #
  124. # The character-set section describes the characters that can be part of
  125. # a word.  A char-stmt describes single characters;  a string-stmt
  126. # describes characters that must appear together as a string.  Either may
  127. # also describe conversion between upper and lower case.
  128. #
  129. # char-stmt    :    "wordchars" character-range
  130. #        |    "wordchars" lowercase-range uppercase-range
  131. #        |    "boundarychars" character-range
  132. #        |    "boundarychars" lowercase-range uppercase-range
  133. # string-stmt    :    "stringchar" string
  134. #        |    "stringchar" lowercase-string uppercase-string
  135. #
  136. # Characters described with the "boundarychars" statement are considered
  137. # part of a word only if they are embedded between characters declared with
  138. # the "wordchars" or "stringchar" statements.
  139. #
  140. # If two ranges or strings are given in a statement, the first describes
  141. # characters that are interpreted as lowercase and the second describes
  142. # uppercase.  In the case of a string-stmt, the two strings must be of the
  143. # same length.  Also, in a string-stmt, the actual strings may contain
  144. # both uppercase and characters themselves without difficulty;  for instance
  145. # the statement
  146. #
  147. #    stringchar    \\*(sS    \\*(Ss
  148. #
  149. # is legal and will not interfere with (or be interfered with by) other
  150. # declarations of of "s" and "S" as lower and upper case, respectively.
  151. #
  152. # A final note on string characters:  some languages (e.g., German) collate
  153. # certain special characters as if they were strings.  For example, "a-umlaut"
  154. # is traditionally sorted as if it were "ae".  Ispell is not capable of this;
  155. # each character must be treated as an individual entity.  So in certain cases,
  156. # ispell will sort a list of words into a different order than the standard
  157. # "dictionary" order for the subject language.
  158. #
  159. # A range is given as in egrep and the shell:  [a-z] means lowercase
  160. # alphabetics;  [^a-z] means all but lowercase, etc.  If more than
  161. # one statement of a type is given, the characters given are combined
  162. # to produce the final list of characters.
  163. #
  164. # In addition to defining the character sets, the order of these statements
  165. # defines the collating sequence for sorts.  If a range is given, the
  166. # characters defined by that statement will collate in their ASCII order.
  167. #
  168. # The character-declaration statements have a rather strange behavior caused
  169. # by the need to match each lowercase character with its uppercase equivalent.
  170. # In any given "wordchars" or "boundarychars" statement, the characters in
  171. # each range are first sorted into ASCII collating sequence, then matched
  172. # one-for-one with the other range.  (The two ranges must have the same
  173. # number of characters).  Thus, for example, the two statements:
  174. #
  175. #    wordchars [aeiou] [AEIOU]
  176. #    wordchars [aeiou] [UOIEA]
  177. #
  178. # would produce exactly the same effect.  To get the vowels to match
  179. # up "wrong", you would have to use separate statements:
  180. #
  181. #    wordchars a U
  182. #    wordchars e O
  183. #    wordchars i I
  184. #    wordchars o I
  185. #    wordchars u A
  186. #
  187. # which would cause myupper('e') to be 'O', and mylower('O') to be 'e'.
  188. #
  189. # This should normally be a problem only with languages which have been
  190. # forced to use a strange ASCII collating sequence.  If your uppercase
  191. # and lowercase letters both collate in the same order, and your lowercase
  192. # characters are selected from the "lowercase specials" -- `~{}| --
  193. # you shouldn't have to worry about this "feature".
  194. #
  195. # The prefixes and suffixes section have exactly the same syntax, except
  196. # that one is introduced with "prefixes" and one with "suffixes".  I'll
  197. # describe them together.
  198. #
  199. # prefixes    :    "prefixes" table*
  200. # suffixes    :    "suffixes" table*
  201. # table        :    flagdef*
  202. # flagdef    :    "flag" [*] <character> ":" replacement*
  203. #
  204. # A prefix or suffix table consists of an introductory keyword and a list
  205. # of flag definitions.  Flags can be defined more than once, in which case
  206. # the definitions are combined.  Each flag controls one or more "replacements"
  207. # which are conditionally applied to the beginnings or endings of various
  208. # words.
  209. #
  210. # Flags are named by a single character.  Depending on a configuration file
  211. # define, this character can be either an uppercase letter (the default
  212. # configuration) or any 7-bit ASCII character.  Most languages should be
  213. # able to get along with just 26 flags, though.
  214. #
  215. # If an asterisk is placed before the flag character, it means that this
  216. # flag participates in cross-product formation.  This only matters if the
  217. # file describes both prefixes and suffixes.  If so, all prefixes and
  218. # suffixes marked with an asterisk will be applied in all combinations
  219. # to the root word.  This can form a large number of words quickly, some
  220. # of which may be illegal, so watch out.  If cross-products produce illegal
  221. # words, "munchlist" will not produce those flag combinations, and you
  222. # will just waste time (yours and ispell's).
  223. #
  224. # replacement    :    condition* ">" [ "-" strip-string "," ] append-string
  225. #
  226. # A replacement is a conditional rule for modifying a root word.  Up to
  227. # 8 conditions may be specified.  If the conditions are satisfied, the
  228. # rules on the right-hand side of the replacement are followed.  If a
  229. # strip-string is given, it is first stripped from the beginning or ending
  230. # (as appropriate) of the root word.  Then the append-string is added at
  231. # that point.  For example, the condition "." means "any word", and the
  232. # condition "Y" means "any word ending in Y".  The following (suffix)
  233. # replacements:
  234. #
  235. #    .    >    MENT
  236. #    Y    >    -Y,IES
  237. #
  238. # would change "induce" to "inducement" and "fly" to "flies".  (If they
  239. # were controlled by the same flag, they would also change "fly" to "flyment",
  240. # which might not be what was wanted).
  241. #
  242. # No matter how much you might wish it, the strings on the right must be
  243. # strings of specific characters, not ranges.  The reasons are rooted deeply
  244. # in the way ispell work, and it would be difficult or impossible to provide
  245. # for more flexibility.  For example, you might wish to write:
  246. #
  247. #    [EY]    >    -[EY],IES
  248. #
  249. # Too bad.  You have to write it as two separate rules:
  250. #
  251. #    E    >    -E,IES
  252. #    Y    >    -Y,IES
  253. #
  254. # condition    :    { "." | character | range }
  255. #
  256. # A condition is a restriction on the characters that adjoin and/or are
  257. # replaced by the right-hand side of the replacement.  Up to 8 conditions
  258. # may be given, which should be enough context for anyone.  The right-hand
  259. # side will be applied only if the conditions in the replacement are
  260. # satisfied.  The conditions also implicitly define a length;  roots
  261. # shorter than the number of conditions will not pass the test.  (As a
  262. # special case, a condition of a single dot "." defines a length of zero,
  263. # so that the rule applies to all words indiscriminately).
  264. #
  265. # Conditions that are single characters should be separated by white space.
  266. #
  267. # An example from below:
  268. #
  269. # flag *S:
  270. #    [^AEIOU]Y    >    -Y,IES        # As in imply > implies
  271. #    [AEIOU]Y    >    S        # As in convey > conveys
  272. #    [SXZH]    >    ES        # As in fix > fixes
  273. #    [^SXZHY]    >    S        # As in bat > bats
  274. #
  275. # The first line applies to words ending in Y, but not in vowel-Y.  The
  276. # second takes care of the vowel-Y words.  The third then handles those
  277. # words that end in a sibilant or near-sibilant, and the last picks up
  278. # everything else.
  279. #
  280. # Note that the conditions are written very carefully so that they apply
  281. # to disjoint sets of words.  In particular, note that the fourth line
  282. # excludes words ending in Y as well as the obvious SXZH.  Otherwise, it
  283. # would convert "imply" into "implys".
  284. #
  285. # Although we do not do so in this file, we could also have a flag
  286. # generate more than one variation on a root word.  For example, we
  287. # could extend the "R" flag as follows:
  288. #
  289. # flag *R:
  290. #    E        >    R        # As in skate > skater
  291. #    E        >    RS        # As in skate > skaters
  292. #    [^AEIOU]Y    >    -Y,IER        # As in multiply > multiplier
  293. #    [^AEIOU]Y    >    -Y,IERS        # As in multiply > multipliers
  294. #    [AEIOU]Y    >    ER        # As in convey > conveyer
  295. #    [AEIOU]Y    >    ERS        # As in convey > conveyers
  296. #    [^EY]    >    ER        # As in build > builder
  297. #    [^EY]    >    ERS        # As in build > builders
  298. #
  299. # This flag would generate both "skater" and "skaters" from "skate".  This
  300. # capability can be very useful in language that make use of noun, verb,
  301. # and adjective endings.  For instance, one could define a single flag
  302. # that generated all of the German "weak" verb endings.
  303. #
  304.  
  305. nroffchars    ().\\*
  306. texchars    ()\[]{}<\>\\$*.%
  307.  
  308. #    And now to the English table itself
  309.  
  310. # First we declare the character set.  Since it's English, it's easy.
  311. # The only special character is the apostrophe, so that possessives can
  312. # be handled.  We declare it as a boundary character, so that quoting with
  313. # single quotes doesn't confuse things.  The apostrophe is the only
  314. # character that gets such treatment.
  315. #
  316. # We declare the apostrophe first so that "Jon's" collates before "Jonas".
  317. # (This is the way ASCII does it).
  318. #
  319.  
  320. boundarychars '
  321. wordchars [a-z] [A-Z]
  322.  
  323. # Here's a record of flags used, in case you want to add new ones.
  324. # Right now, we fit within the minimal MASKBITS definition.
  325. #
  326. #            ABCDEFGHIJKLMNOPQRSTUVWXYZ
  327. # Used:      *  *  ****  ** * ***** ***
  328. #            A  D  GHIJ  MN P RSTUV XYZ
  329. # Available:  -- --    --  - -     -
  330. #             BC EF    KL  O Q     W
  331.  
  332. # Now the prefix table.  There are only three prefixes that are truly
  333. # frequent in English, and none of them seem to need conditional variations.
  334. #
  335. prefixes
  336.  
  337. flag *A:
  338.     .        >    RE        # As in enter > reenter
  339.  
  340. flag *I:
  341.     .        >    IN        # As in disposed > indisposed
  342.  
  343. flag *U:
  344.     .        >    UN        # As in natural > unnatural
  345.  
  346. # Finally, the suffixes.  These are exactly the suffixes that came out
  347. # with the original "ispell";  I haven't tried to improve them.  The only
  348. # thing I did besides translate them was to add selected cross-product flags.
  349. #
  350. suffixes
  351.  
  352. flag V:
  353.     E        >    -E,IVE        # As in create > creative
  354.     [^E]    >    IVE        # As in prevent > preventive
  355.  
  356. flag *N:
  357.     E        >    -E,ION        # As in create > creation
  358.     Y        >    -Y,ICATION    # As in multiply > multiplication
  359.     [^EY]    >    EN        # As in fall > fallen
  360.  
  361. flag *X:
  362.     E        >    -E,IONS        # As in create > creations
  363.     Y        >    -Y,ICATIONS    # As in multiply > multiplications
  364.     [^EY]    >    ENS        # As in weak > weakens
  365.  
  366. flag H:
  367.     Y        >    -Y,IETH        # As in twenty > twentieth
  368.     [^Y]    >    TH        # As in hundred > hundredth
  369.  
  370. flag *Y:
  371.     .        >    LY        # As in quick > quickly
  372.  
  373. flag *G:
  374.     E        >    -E,ING        # As in file > filing
  375.     [^E]    >    ING        # As in cross > crossing
  376.  
  377. flag *J:
  378.     E        >    -E,INGS        # As in file > filings
  379.     [^E]    >    INGS        # As in cross > crossings
  380.  
  381. flag *D:
  382.     E        >    D        # As in create > created
  383.     [^AEIOU]Y    >    -Y,IED        # As in imply > implied
  384.     [^EY]    >    ED        # As in cross > crossed
  385.     [AEIOU]Y    >    ED        # As in convey > conveyed
  386.  
  387. flag T:
  388.     E        >    ST        # As in late > latest
  389.     [^AEIOU]Y    >    -Y,IEST        # As in dirty > dirtiest
  390.     [AEIOU]Y    >    EST        # As in gray > grayest
  391.     [^EY]    >    EST        # As in small > smallest
  392.  
  393. flag *R:
  394.     E        >    R        # As in skate > skater
  395.     [^AEIOU]Y    >    -Y,IER        # As in multiply > multiplier
  396.     [AEIOU]Y    >    ER        # As in convey > conveyer
  397.     [^EY]    >    ER        # As in build > builder
  398.  
  399. flag *Z:
  400.     E        >    RS        # As in skate > skaters
  401.     [^AEIOU]Y    >    -Y,IERS        # As in multiply > multipliers
  402.     [AEIOU]Y    >    ERS        # As in convey > conveyers
  403.     [^EY]    >    ERS        # As in build > builders
  404.  
  405. flag *S:
  406.     [^AEIOU]Y    >    -Y,IES        # As in imply > implies
  407.     [AEIOU]Y    >    S        # As in convey > conveys
  408.     [SXZH]    >    ES        # As in fix > fixes
  409.     [^SXZHY]    >    S        # As in bat > bats
  410.  
  411. flag *P:
  412.     [^AEIOU]Y    >    -Y,INESS    # As in cloudy > cloudiness
  413.     [AEIOU]Y    >    NESS        # As in gray > grayness
  414.     [^Y]    >    NESS        # As in late > lateness
  415.  
  416. flag *M:
  417.     .        >    'S        # As in dog > dog's
  418.