home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 8 Other / 08-Other.zip / ispel32r.zip / ispell_4.txt < prev    next >
Text File  |  2002-03-09  |  32KB  |  793 lines

  1.  
  2.  
  3.  
  4. ISPELL(4)                                               ISPELL(4)
  5.  
  6.  
  7. NAME
  8.        ispell - format of ispell dictionaries and affix files
  9.  
  10. DESCRIPTION
  11.        Ispell(1)  requires  two files to define the language that
  12.        it is spell-checking.  The first file is a dictionary con-
  13.        taining  words  for  the  language,  and  the second is an
  14.        "affix" file that defines the meaning of special flags  in
  15.        the  dictionary.   The two files are combined by buildhash
  16.        (see ispell(1)) and written to a hash file  which  is  not
  17.        described here.
  18.  
  19.        A  raw  ispell  dictionary  (either the main dictionary or
  20.        your own personal dictionary) contains a  list  of  words,
  21.        one  per  line.  Each word may optionally be followed by a
  22.        slash ("/") and one or more flags, which modify  the  root
  23.        word  as  explained  below.  Depending on the options with
  24.        which ispell was built, case may or may not be significant
  25.        in  either  the  root  word  or  the flags, independently.
  26.        Specifically, if the compile-time option CAPITALIZATION is
  27.        defined,  case  is  significant  in the root word; if not,
  28.        case is ignored in the root  word.   If  the  compile-time
  29.        option  MASKBITS  is set to a value of 32, case is ignored
  30.        in the flags; otherwise case is significant in the  flags.
  31.        Contact your system administrator or ispell maintainer for
  32.        more information (or use the -vv flag to find  out).   The
  33.        dictionary  should  be  sorted with the -f flag of sort(1)
  34.        before the hash file is built; this is done  automatically
  35.        by  munchlist(1), which is the normal way of building dic-
  36.        tionaries.
  37.  
  38.        If the dictionary contains words that have string  charac-
  39.        ters  (see  the affix-file documentation below), they must
  40.        be written in the format given by the defstringtype state-
  41.        ment  in  the  affix file.  This will be the case for most
  42.        non-English languages.  Be careful  to  use  this  format,
  43.        rather  than  that of your favorite formatter, when adding
  44.        words to a dictionary.  (If you add words to your personal
  45.        dictionary  during  an ispell session, they will automati-
  46.        cally be converted to the correct  format.   This  feature
  47.        can be used to convert an entire dictionary if necessary:)
  48.  
  49.                    echo qqqqq > dummy.dict
  50.                    buildhash dummy.dict affix-file dummy.hash
  51.                    awk '{print "*"}END{print "#"}' old-dict-file \
  52.                    | ispell -a -T old-dict-string-type \
  53.                      -d ./dummy.hash -p ./new-dict-file \
  54.                      > /dev/null
  55.                    rm dummy.*
  56.  
  57.        The case of the root  word  controls  the  case  of  words
  58.        accepted by ispell, as follows:
  59.  
  60.        (1)    If  the root word appears only in lower case (e.g.,
  61.  
  62.  
  63.  
  64.                               local                             1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ISPELL(4)                                               ISPELL(4)
  71.  
  72.  
  73.               bob), it will be accepted in lower  case,  capital-
  74.               ized, or all capitals.
  75.  
  76.        (2)    If   the   root  word  appears  capitalized  (e.g.,
  77.               Robert), it will not be accepted in all-lower case,
  78.               but  will  be  accepted capitalized or all in capi-
  79.               tals.
  80.  
  81.        (3)    If the root word appears  all  in  capitals  (e.g.,
  82.               UNIX), it will only be accepted all in capitals.
  83.  
  84.        (4)    If the root word appears with a "funny" capitaliza-
  85.               tion (e.g., ITCorp), a word will be  accepted  only
  86.               if it follows that capitalization, or if it appears
  87.               all in capitals.
  88.  
  89.        (5)    More than one capitalization of  a  root  word  may
  90.               appear  in  the  dictionary.   Flags from different
  91.               capitalizations  are  combined   by   OR-ing   them
  92.               together.
  93.  
  94.        Redundant capitalizations (e.g., bob and Bob) will be com-
  95.        bined by buildhash and by ispell (for personal  dictionar-
  96.        ies),  and  can be removed from a raw dictionary by munch-
  97.        list.
  98.  
  99.        For example, the dictionary:
  100.  
  101.               bob
  102.               Robert
  103.               UNIX
  104.               ITcorp
  105.               ITCorp
  106.  
  107.        will accept bob, Bob, BOB, Robert, ROBERT,  UNIX,  ITcorp,
  108.        ITCorp,  and  ITCORP, and will reject all others.  Some of
  109.        the unacceptable forms are bOb, robert, Unix, and  ItCorp.
  110.  
  111.        As  mentioned  above,  root words in any dictionary may be
  112.        extended by flags.  Each flag is a single alphabetic char-
  113.        acter,  which  represents  a  prefix or suffix that may be
  114.        added to the root to form a new word.  For example, in  an
  115.        English  dictionary  the  D  flag can be added to bathe to
  116.        make bathed.  Since flags are represented as a single  bit
  117.        in  the  hashed  dictionary,  this  results in significant
  118.        space savings.  The munchlist script will reduce an exist-
  119.        ing raw dictionary by adding flags when possible.
  120.  
  121.        When  a  word is extended with an affix, the affix will be
  122.        accepted only if it appears in the same case as  the  ini-
  123.        tial (prefix) or final (suffix) letter of the word.  Thus,
  124.        for example, the entry UNIX/M in the  main  dictionary  (M
  125.        means  add  an apostrophe and an "s" to make a possessive)
  126.        would accept UNIX'S but would reject UNIX's.  If UNIX's is
  127.  
  128.  
  129.  
  130.                               local                             2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. ISPELL(4)                                               ISPELL(4)
  137.  
  138.  
  139.        legal,  it must appear as a separate dictionary entry, and
  140.        it will not be combined by munchlist.   (In  general,  you
  141.        don't  need to worry about these things; munchlist guaran-
  142.        tees that its output dictionary will accept the  same  set
  143.        of  words as its input, so all you have to do is add words
  144.        to the dictionary and occasionally run munchlist to reduce
  145.        its size).
  146.  
  147.        As  mentioned,  the  affix  definition  file describes the
  148.        affixes  associated  with  particular  flags.    It   also
  149.        describes the character set used by the language.
  150.  
  151.        Although  the  affix-definition  grammar is designed for a
  152.        line-oriented layout, it is actually  a  free-format  yacc
  153.        grammar and can be laid out weirdly if you want.  Comments
  154.        are started by a pound (sharp) sign (#), and  continue  to
  155.        the  end  of  the  line.  Backslashes are supported in the
  156.        usual fashion (\nnn, plus specials \n, \r, \t, \v, \f, \b,
  157.        and  the new hex format \xnn).  Any character with special
  158.        meaning to the parser can be changed to  an  uninterpreted
  159.        token  by  backslashing it; for example, you can declare a
  160.        flag named 'asterisk' or 'colon' with  flag  \*:  or  flag
  161.        \::.
  162.  
  163.        The  grammar will be presented in a top-down fashion, with
  164.        discussion of each element.  An affix-definition file must
  165.        contain exactly one table:
  166.  
  167.               table     :    [headers] [prefixes] [suffixes]
  168.  
  169.        At  least  one of prefixes and suffixes is required.  They
  170.        can appear in either order.
  171.  
  172.               headers   :    [ options ] char-sets
  173.  
  174.        The headers describe options global to this dictionary and
  175.        language.  These include the character sets to be used and
  176.        the formatter, and the defaults for certain ispell  flags.
  177.  
  178.               options : { fmtr-stmt | opt-stmt | flag-stmt | num-stmt }
  179.  
  180.        The  options  statements  define  the defaults for certain
  181.        ispell flags and for the character sets used by  the  for-
  182.        matters.
  183.  
  184.               fmtr-stmt :    { nroff-stmt | tex-stmt }
  185.  
  186.        A fmtr-stmt describes characters that have special meaning
  187.        to a formatter.  Normally, this statement  is  not  neces-
  188.        sary,  but  some  languages  may  have preempted the usual
  189.        defaults for use as language-specific characters.  In this
  190.        case, these statements may be used to redefine the special
  191.        characters expected by the formatter.
  192.  
  193.  
  194.  
  195.  
  196.                               local                             3
  197.  
  198.  
  199.  
  200.  
  201.  
  202. ISPELL(4)                                               ISPELL(4)
  203.  
  204.  
  205.               nroff-stmt     :    { nroffchars | troffchars } string
  206.  
  207.        The nroffchars statement allows  redefinition  of  certain
  208.        nroff  control  characters.   The  string  given  must  be
  209.        exactly five characters long, and must list  substitutions
  210.        for  the  left  and  right parentheses ("()") , the period
  211.        ("."), the backslash ("\"), and the asterisk ("*").   (The
  212.        right  parenthesis  is not currently used, but is included
  213.        for completeness.)  For example, the statement:
  214.  
  215.               nroffchars {}.\\*
  216.  
  217.        would replace the left and right parentheses with left and
  218.        right  curly  braces  for  purposes of parsing nroff/troff
  219.        strings, with no effect on the others (admittedly  a  con-
  220.        trived  example).  Note that the backslash is escaped with
  221.        a backslash.
  222.  
  223.               tex-stmt  :    { TeXchars | texchars } string
  224.  
  225.        The TeXchars  statement  allows  redefinition  of  certain
  226.        TeX/LaTeX  control  characters.   The string given must be
  227.        exactly thirteen characters long, and must list  substitu-
  228.        tions for the left and right parentheses ("()") , the left
  229.        and right square brackets ("[]"), the left and right curly
  230.        braces  ("{}"),  the left and right angle brackets ("<>"),
  231.        the backslash ("\"), the dollar sign ("$"),  the  asterisk
  232.        ("*"),  the  period  or  dot  ("."),  and the percent sign
  233.        ("%").  For example, the statement:
  234.  
  235.               texchars ()\[]<\><\>\\$*.%
  236.  
  237.        would replace the functions of the left  and  right  curly
  238.        braces with the left and right angle brackets for purposes
  239.        of parsing TeX/LaTeX  constructs,  while  retaining  their
  240.        functions  for  the  tib bibliographic preprocessor.  Note
  241.        that the backslash, the left square bracket, and the right
  242.        angle bracket must be escaped with a backslash.
  243.  
  244.               opt-stmt  :    { cmpnd-stmt | aff-stmt }
  245.  
  246.               cmpnd-stmt     :    compoundwords compound-opt
  247.  
  248.               aff-stmt       :    allaffixes on-or-off
  249.  
  250.               on-or-off :    { on | off }
  251.  
  252.               compound-opt : { on-or-off | controlled character }
  253.  
  254.        An opt-stmt controls certain ispell defaults that are best
  255.        made language-specific.  The allaffixes statement controls
  256.        the  default  for  the  -P  and  -m options to ispell.  If
  257.        allaffixes  is  turned  off  (the  default),  ispell  will
  258.        default  to  the  behavior  of  the  -P  flag:  root/affix
  259.  
  260.  
  261.  
  262.                               local                             4
  263.  
  264.  
  265.  
  266.  
  267.  
  268. ISPELL(4)                                               ISPELL(4)
  269.  
  270.  
  271.        suggestions will only  be  made  if  there  are  no  "near
  272.        misses".   If allaffixes is turned on, ispell will default
  273.        to the behavior of the  -m  flag:  root/affix  suggestions
  274.        will always be made.  The compoundwords statement controls
  275.        the default for the -B and -C options to ispell.  If  com-
  276.        poundwords  is  turned  off  (the  default),  ispell  will
  277.        default to the behavior of the -B flag: run-together words
  278.        will  be  reported  as errors.  If compoundwords is turned
  279.        on, ispell will default to the behavior of  the  -C  flag:
  280.        run-together words will be considered as compounds if both
  281.        are in the dictionary.  This is useful for languages  such
  282.        as  German and Norwegian, which form large numbers of com-
  283.        pound words.  Finally, if compoundwords  is  set  to  con-
  284.        trolled,  only  words  marked  with  the flag indicated by
  285.        character (which should not be  otherwise  used)  will  be
  286.        allowed  to  participate  in  compound formation.  Because
  287.        this option requires the flags to be specified in the dic-
  288.        tionary, it is not available from the command line.
  289.  
  290.               flag-stmt :    flagmarker character
  291.  
  292.        The  flagmarker statement describes the character which is
  293.        used to separate affix flags from the root word in  a  raw
  294.        dictionary  file.   This  must be a character which is not
  295.        found in any word (including  in  string  characters;  see
  296.        below).   The default is "/" because this character is not
  297.        normally used to represent special characters in any  lan-
  298.        guage.
  299.  
  300.               num-stmt  :    compoundmin digit
  301.  
  302.        The  compoundmin  statement controls the length of the two
  303.        components of a compound word.  This only has an effect if
  304.        compoundwords  is  turned on or if the -C flag is given to
  305.        ispell.  In that case, only words at least as long as  the
  306.        given  minimum  will  be  accepted as components of a com-
  307.        pound.  The default is 3 characters.
  308.  
  309.               char-sets :    norm-sets [ alt-sets ]
  310.  
  311.        The character-set section describes  the  characters  that
  312.        can  be part of a word, and defines their collating order.
  313.        There must always be a definition  of  "normal"  character
  314.        sets;  in addition, there may be one or more partial defi-
  315.        nitions of "alternate" sets which are  used  with  various
  316.        text formatters.
  317.  
  318.               norm-sets :    [ deftype ] charset-group
  319.  
  320.        A "normal" character set may optionally begin with a defi-
  321.        nition of the file suffixes that make  use  of  this  set.
  322.        Following this are one or more character-set declarations.
  323.  
  324.               deftype : defstringtype name deformatter suffix*
  325.  
  326.  
  327.  
  328.                               local                             5
  329.  
  330.  
  331.  
  332.  
  333.  
  334. ISPELL(4)                                               ISPELL(4)
  335.  
  336.  
  337.        The defstringtype declaration gives a list  of  file  suf-
  338.        fixes  which should make use of the default string charac-
  339.        ters defined as part of the base character set; it is only
  340.        necessary  if  string  characters  are being defined.  The
  341.        name parameter is a string giving the unique name  associ-
  342.        ated  with  these  suffixes; often it is a formatter name.
  343.        If the formatter is a member of the troff family,  "nroff"
  344.        should be used for the name associated with the most popu-
  345.        lar macro package; members of the TeX  family  should  use
  346.        "tex".   Other names may be chosen freely, but they should
  347.        be kept simple, as they are used in ispell 's -T switch to
  348.        specify a formatter type.  The deformatter parameter spec-
  349.        ifies the deformatting style to use when processing  files
  350.        with  the  given suffixes.  Currently, this must be either
  351.        tex or nroff.  The suffix parameters are a whitespace-sep-
  352.        arated  list  of strings which, if present at the end of a
  353.        filename, indicate that the associated set of string char-
  354.        acters should be used by default for this file.  For exam-
  355.        ple, the  suffix  list  for  the  troff  family  typically
  356.        includes suffixes such as ".ms", ".me", ".mm", etc.
  357.  
  358.               charset-group :     { char-stmt | string-stmt | dup-stmt}*
  359.  
  360.        A  char-stmt  describes  single  characters; a string-stmt
  361.        describes  characters  that  must  appear  together  as  a
  362.        string,  and which usually represent a single character in
  363.        the target language.  Either may also describe  conversion
  364.        between  upper  and  lower  case.   A  dup-stmt is used to
  365.        describe alternate forms of string characters, so  that  a
  366.        single dictionary may be used with several formatting pro-
  367.        grams that use different conventions for representing non-
  368.        ASCII characters.
  369.  
  370.               char-stmt :    wordchars character-range
  371.                         |    wordchars lowercase-range uppercase-range
  372.                         |    boundarychars character-range
  373.                         |    boundarychars lowercase-range uppercase-range
  374.               string-stmt    :    stringchar string
  375.                         |    stringchar lowercase-string uppercase-string
  376.  
  377.        Characters  described with the boundarychars statement are
  378.        considered part of a word  only  if  they  appear  singly,
  379.        embedded between characters declared with the wordchars or
  380.        stringchar statements.  For example, if the  hyphen  is  a
  381.        boundary  character  (useful  in French), the string "foo-
  382.        bar" would be a single word, but "-foo" would be the  same
  383.        as  "foo",  and "foo--bar" would be two words separated by
  384.        non-word characters.
  385.  
  386.        If two ranges or strings  are  given  in  a  char-stmt  or
  387.        string-stmt,  the  first  describes  characters  that  are
  388.        interpreted as lowercase and the second  describes  upper-
  389.        case.   In  the  case  of  a stringchar statement, the two
  390.        strings must be of the same length.  Also, in a stringchar
  391.  
  392.  
  393.  
  394.                               local                             6
  395.  
  396.  
  397.  
  398.  
  399.  
  400. ISPELL(4)                                               ISPELL(4)
  401.  
  402.  
  403.        statement,  the  actual strings may contain both uppercase
  404.        and  characters   themselves   without   difficulty;   for
  405.        instance, the statement
  406.  
  407.               stringchar     "\\*(sS"  "\\*(Ss"
  408.  
  409.        is  legal  and  will  not interfere with (or be interfered
  410.        with by) other declarations of of "s" and "S" as lower and
  411.        upper case, respectively.
  412.  
  413.        A  final note on string characters: some languages collate
  414.        certain special characters as if they were  strings.   For
  415.        example,  the German "a-umlaut" is traditionally sorted as
  416.        if it were "ae".  Ispell is  not  capable  of  this;  each
  417.        character  must be treated as an individual entity.  So in
  418.        certain cases, ispell will sort a list  of  words  into  a
  419.        different  order  than the standard "dictionary" order for
  420.        the target language.
  421.  
  422.               alt-sets  :    alttype [ alt-stmt* ]
  423.  
  424.        Because different formatters use  different  notations  to
  425.        represent  non-ASCII  characters,  ispell must be aware of
  426.        the representations used by these formatters.   These  are
  427.        declared as alternate sets of string characters.
  428.  
  429.               alttype   :    altstringtype name suffix*
  430.  
  431.        The altstringtype statement introduces each set by declar-
  432.        ing the associated  formatter  name  and  filename  suffix
  433.        list.   This  name  and list are interpreted exactly as in
  434.        the defstringtype statement above.  Following this  header
  435.        are  one  or  more  alt-stmts  which declare the alternate
  436.        string characters used by this formatter.
  437.  
  438.               alt-stmt       :    altstringchar alt-string std-string
  439.  
  440.        The altstringchar statement describes alternate  represen-
  441.        tations for string characters.  For example, the -mm macro
  442.        package of troff represents the German "a-umlaut" as a\*:,
  443.        while  TeX  uses  the sequence \"a.  If the troff versions
  444.        are declared as the standard  versions  using  stringchar,
  445.        the  TeX  versions  may be declared as alternates by using
  446.        the statement
  447.  
  448.               altstringchar  \\\"a     a\\*:
  449.  
  450.        When the altstringchar statement is used to specify alter-
  451.        nate  forms,  all forms for a particular formatter must be
  452.        declared together as a group.   Also,  each  formatter  or
  453.        macro  package  must provide a complete set of characters,
  454.        both upper- and lower-case, and  the  character  sequences
  455.        used  for  each  formatter  must  be  completely distinct.
  456.        Character sequences which describe upper-  and  lower-case
  457.  
  458.  
  459.  
  460.                               local                             7
  461.  
  462.  
  463.  
  464.  
  465.  
  466. ISPELL(4)                                               ISPELL(4)
  467.  
  468.  
  469.        versions  of the same printable character must also be the
  470.        same length.  It may  be  necessary  to  define  some  new
  471.        macros  for  a  given  formatter to satisfy these restric-
  472.        tions.  (The current version of buildhash does not enforce
  473.        these restrictions, but failure to obey them may result in
  474.        errors being introduced into files that are processed with
  475.        ispell.)
  476.  
  477.        An  important  minor point is that ispell assumes that all
  478.        characters declared as  wordchars  or  boundarychars  will
  479.        occupy exactly one position on the terminal screen.
  480.  
  481.        A single character-set statement can declare either a sin-
  482.        gle character or a  contiguous  range  of  characters.   A
  483.        range is given as in egrep and the shell: [a-z] means low-
  484.        ercase alphabetics; [^a-z] means all but  lowercase,  etc.
  485.        All  character-set  statements  are  combined (unioned) to
  486.        produce the final list of characters that may be part of a
  487.        word.  The collating order of the characters is defined by
  488.        the order of their declaration; if a range  is  used,  the
  489.        characters  are  considered to have been declared in ASCII
  490.        order.  Characters that have case  are  collated  next  to
  491.        each other, with the uppercase character first.
  492.  
  493.        The character-declaration statements have a rather strange
  494.        behavior caused by its need to match each lowercase  char-
  495.        acter  with  its uppercase equivalent.  In any given word-
  496.        chars or boundarychars statement, the characters  in  each
  497.        range are first sorted into ASCII collating sequence, then
  498.        matched one-for-one with the other range.  (The two ranges
  499.        must have the same number of characters).  Thus, for exam-
  500.        ple, the two statements:
  501.  
  502.               wordchars [aeiou] [AEIOU]
  503.               wordchars [aeiou] [UOIEA]
  504.  
  505.        would produce exactly the same effect.  To get the  vowels
  506.        to match up "wrong", you would have to use separate state-
  507.        ments:
  508.  
  509.               wordchars a U
  510.               wordchars e O
  511.               wordchars i I
  512.               wordchars o E
  513.               wordchars u A
  514.  
  515.        which would cause uppercase 'e' to be 'O',  and  lowercase
  516.        'O'  to  be  'e'.   This should normally be a problem only
  517.        with languages which have been forced  to  use  a  strange
  518.        ASCII collating sequence.  If your uppercase and lowercase
  519.        letters both collate in the same order, you shouldn't have
  520.        to worry about this "feature".
  521.  
  522.        The  prefixes  and suffixes sections have exactly the same
  523.  
  524.  
  525.  
  526.                               local                             8
  527.  
  528.  
  529.  
  530.  
  531.  
  532. ISPELL(4)                                               ISPELL(4)
  533.  
  534.  
  535.        syntax, except for the introductory keyword.
  536.  
  537.               prefixes  :    prefixes flagdef*
  538.               suffixes  :    suffixes flagdef*
  539.               flagdef   :    flag [*|~] char : repl*
  540.  
  541.        A prefix or suffix table consists of an introductory  key-
  542.        word and a list of flag definitions.  Flags can be defined
  543.        more than once, in which case  the  definitions  are  com-
  544.        bined.   Each  flag  controls  one or more repls (replace-
  545.        ments) which are conditionally applied to  the  beginnings
  546.        or endings of various words.
  547.  
  548.        Flags  are named by a single character char.  Depending on
  549.        a configuration option, this character can be  either  any
  550.        uppercase  letter (the default configuration) or any 7-bit
  551.        ASCII character.  Most languages should  be  able  to  get
  552.        along with just 26 flags.
  553.  
  554.        A  flag  character may be prefixed with one or more option
  555.        characters.  (If you wish to use one of the option charac-
  556.        ters  as  a  flag  character,  simply enclose it in double
  557.        quotes.)
  558.  
  559.        The asterisk (*) option means that this flag  participates
  560.        in cross-product formation.  This only matters if the file
  561.        contains both prefix and suffix tables.  If so,  all  pre-
  562.        fixes and suffixes marked with an asterisk will be applied
  563.        in all cross-combinations to the root word.  For  example,
  564.        consider  the  root fix with prefixes pre and in, and suf-
  565.        fixes es and ed.  If all flags controlling these  prefixes
  566.        and  suffixes are marked with an asterisk, then the single
  567.        root fix would also generate prefix,  prefixes,  prefixed,
  568.        infix,  infixes,  infixed,  fix, fixes, and fixed.  Cross-
  569.        product formation can produce  a  large  number  of  words
  570.        quickly,  some  of which may be illegal, so watch out.  If
  571.        cross-products produce illegal words, munchlist  will  not
  572.        produce  those flag combinations, and the flag will not be
  573.        useful.
  574.  
  575.               repl :    condition* > [ - strip-string , ] append-string
  576.  
  577.        The ~ option specifies that the associated  flag  is  only
  578.        active when a compound word is being formed.  This is use-
  579.        ful in a language like German, where the form  of  a  word
  580.        sometimes changes inside a compound.
  581.  
  582.        A  repl  is  a conditional rule for modifying a root word.
  583.        Up to 8 conditions may be specified.   If  the  conditions
  584.        are  satisfied,  the  rules  on the right-hand side of the
  585.        repl are applied, as follows:
  586.  
  587.        (1)    If a strip-string is given, it  is  first  stripped
  588.               from  the  beginning  or ending (as appropriate) of
  589.  
  590.  
  591.  
  592.                               local                             9
  593.  
  594.  
  595.  
  596.  
  597.  
  598. ISPELL(4)                                               ISPELL(4)
  599.  
  600.  
  601.               the root word.
  602.  
  603.        (2)    Then the append-string is added at that point.
  604.  
  605.        For example, the condition .  means "any  word",  and  the
  606.        condition  Y  means "any word ending in Y".  The following
  607.        (suffix) replacements:
  608.  
  609.               .    >    MENT
  610.               Y    >    -Y,IES
  611.  
  612.        would change induce to inducement and fly to  flies.   (If
  613.        they  were  controlled  by  the same flag, they would also
  614.        change fly to flyment, which might not be what was wanted.
  615.        Munchlist  can  be  used  to  protect against this sort of
  616.        problem; see the command sequence given below.)
  617.  
  618.        No matter how much you might wish it, the strings  on  the
  619.        right  must be strings of specific characters, not ranges.
  620.        The reasons are rooted deeply in the way ispell works, and
  621.        it  would  be  difficult or impossible to provide for more
  622.        flexibility.  For example, you might wish to write:
  623.  
  624.               [EY] >    -[EY],IES
  625.  
  626.        This will not work.  Instead, you must  use  two  separate
  627.        rules:
  628.  
  629.               E    >    -E,IES
  630.               Y    >    -Y,IES
  631.  
  632.        The  application  of  repls  can  be restricted to certain
  633.        words with conditions:
  634.  
  635.               condition :    { . | character | range }
  636.  
  637.        A condition  is  a  restriction  on  the  characters  that
  638.        adjoin, and/or are replaced by, the right-hand side of the
  639.        repl.  Up to 8 conditions may be given,  which  should  be
  640.        enough  context  for  anyone.  The right-hand side will be
  641.        applied only if the conditions in the repl are  satisfied.
  642.        The  conditions  also  implicitly  define  a length; roots
  643.        shorter than the number of conditions will  not  pass  the
  644.        test.  (As a special case, a condition of a single dot "."
  645.        defines a length of zero, so that the rule applies to  all
  646.        words  indiscriminately).   This  length is independent of
  647.        the separate test that insists that all flags  produce  an
  648.        output word length of at least four.
  649.  
  650.        Conditions  that are single characters should be separated
  651.        by white space.  For example, to specify words  ending  in
  652.        "ED", write:
  653.  
  654.               E D  >    -ED,ING        # As in covered > covering
  655.  
  656.  
  657.  
  658.                               local                            10
  659.  
  660.  
  661.  
  662.  
  663.  
  664. ISPELL(4)                                               ISPELL(4)
  665.  
  666.  
  667.        If you write:
  668.  
  669.               ED   >    -ED,ING
  670.  
  671.        the effect will be the same as:
  672.  
  673.               [ED] >    -ED,ING
  674.  
  675.        As  a  final  minor,  but important point, it is sometimes
  676.        useful to rebuild a dictionary file using an  incompatible
  677.        suffix  file.   For  example, suppose you expanded the "R"
  678.        flag to generate "er" and "ers" (thus making  the  Z  flag
  679.        somewhat  obsolete).   To  build  a new dictionary newdict
  680.        that, using newaffixes, will accept exactly the same  list
  681.        of words as the old list olddict did using oldaffixes, the
  682.        -c switch of munchlist is  useful,  as  in  the  following
  683.        example:
  684.  
  685.               $ munchlist -c oldaffixes -l newaffixes olddict > newdict
  686.  
  687.        If you use this procedure, your new dictionary will always
  688.        accept the same list the original did, even if  you  badly
  689.        screwed up the affix file.  This is because munchlist com-
  690.        pares the words generated by a flag with the original word
  691.        list,  and  refuses to use any flags that generate illegal
  692.        words.  (But don't forget that the munchlist step takes  a
  693.        long time and eats up temporary file space).
  694.  
  695. EXAMPLES
  696.        As  an example of conditional suffixes, here is the speci-
  697.        fication of the S flag from the English affix file:
  698.  
  699.               flag *S:
  700.                   [^AEIOU]Y  >    -Y,IES    # As in imply > implies
  701.                   [AEIOU]Y   >    S         # As in convey > conveys
  702.                   [SXZH]     >    ES        # As in fix > fixes
  703.                   [^SXZHY]   >    S         # As in bat > bats
  704.  
  705.        The first line applies to words ending in Y,  but  not  in
  706.        vowel-Y.  The second takes care of the vowel-Y words.  The
  707.        third then handles those words that end in a  sibilant  or
  708.        near-sibilant, and the last picks up everything else.
  709.  
  710.        Note  that  the  conditions  are written very carefully so
  711.        that they apply to disjoint sets of words.  In particular,
  712.        note  that  the  fourth line excludes words ending in Y as
  713.        well as the obvious SXZH.   Otherwise,  it  would  convert
  714.        "imply" into "implys".
  715.  
  716.        Although  the  English  affix file does not do so, you can
  717.        also have a flag generate more than  one  variation  on  a
  718.        root  word.   For example, we could extend the English "R"
  719.        flag as follows:
  720.  
  721.  
  722.  
  723.  
  724.                               local                            11
  725.  
  726.  
  727.  
  728.  
  729.  
  730. ISPELL(4)                                               ISPELL(4)
  731.  
  732.  
  733.               flag *R:
  734.                  E           >    R         # As in skate > skater
  735.                  E           >    RS        # As in skate > skaters
  736.                  [^AEIOU]Y   >    -Y,IER    # As in multiply > multiplier
  737.                  [^AEIOU]Y   >    -Y,IERS   # As in multiply > multipliers
  738.                  [AEIOU]Y    >    ER        # As in convey > conveyer
  739.                  [AEIOU]Y    >    ERS       # As in convey > conveyers
  740.                  [^EY]       >    ER        # As in build > builder
  741.                  [^EY]       >    ERS       # As in build > builders
  742.  
  743.        This flag would generate both "skater" and "skaters"  from
  744.        "skate".   This capability can be very useful in languages
  745.        that make use of noun, verb, and adjective  endings.   For
  746.        instance,  one  could  define a single flag that generated
  747.        all of the German "weak" verb endings.
  748.  
  749. SEE ALSO
  750.        ispell(1)
  751.  
  752.  
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.                               local                            12
  791.  
  792.  
  793.