Further Suffix over an suffix Hunspell

Help
Rui Vilela
2008-07-06
2013-06-03
  • Rui Vilela
    Rui Vilela
    2008-07-06

    Hello, I've been making a new hunspell dictionary for portuguese (Portugal). I co-develop with project natura from natura.di.uminho.pt. We are currently distributing among other things dictionaries for any support available (*spell's).

    I'm aware of the limitations of myspell. And I'm trying to insert features in Myspell that are not used in Myspell (or others...), but they exist in Jspell (International Jspell Version 1.3.0, Copyright (c), 1994-2005 by Ulisses Pinto & Jose Joao Almeida). Jspell it's an morphological  analyzer mainly for portuguese (but we also dictionaries for have english, latin, spanish).

    We have a 3rd feature for the affix rules that allows to apply suffixes after normal suffixation, that were defined on the dictionary (but this 3rd feature can't be mixed with other of the same kind).

    Example (ispell affix file based):

    # conjugação pronominal (compl. directo)
    flag +P:     ; "CAT=v"                  #-o              #noispell
    [AEIOUÉÊ]         >        \-O     ; "G=m,AN=s"          #noispell
    N S             >     -NS,M\-LO  ; "G=m,AN=s"          #noispell
    [^NÁ] S          >     -S,\-LO    ; "G=m,AN=s"          #noispell
    M               >        \-NO    ; "G=m,AN=s"          #noispell

    ...

    flag +L:     ; "CAT=v"             #-lho             #noispell
    .           >      \-LHE    ; "DP=3,DG=_,DN=s"          #noispell
    .           >      \-LHO    ; "DP=3,DG=m,DN=s"          #noispell
    .           >      \-LHA    ; "DP=3,DG=f,DN=s"          #noispell

    ...

    flag *Y:              ; "CAT=v,T=inf"  # Deve ser posta nos verbos regulares

    A R     >  -R,VA        ; "P=1_3,N=s,T=pi"
    A R     >  -R,VAS       ; "P=2,N=s,T=pi"
    A R     >  -AR,ÁVAMOS   ; "P=1,N=p,T=pi"
    A R     >  -AR,ÁVEIS    ; "P=2,N=p,T=pi"

    In dictionary I have something like:

    pastar/#vn/XYPL/

    #vn it's a macro of #vn/CAT=v,T=inf,TR=_// defined on the beginning.
    rule Y will give pastava, pastavas, pastávamos, and pastáveis. X is similar. and applying P I don't have "pastar-o", but i have:
    pastava-o, pastavas-lo, pastávamos-lo, and pastáveis-lo. P can't mix with L. Flag L will give pastar-lhe, pastar-lha, pastar-lho, and also pastava-lh* and pastávamos-lh*

    You can notice that instead of '*' there is a '+'. Not everything can be subjected to affix rulling, we have a file that replaces the irregular forms of verbs.

    $ jspell -a -z
    An example of Jspell output:
    International Jspell Version 1.3.0
    pastávamos-lho
    * pastávamos-lho 0 :lex(pastar, [CAT=v,T=inf,TR=_], [], [P=1,N=p,T=pi], [DP=3,DG=m,DN=s])/YL

    My question is if i can do something similar with hunspell? Hope my English is understandable.
    Regards.

     
    • Rui Vilela
      Rui Vilela
      2008-07-06

      Just to add

      X,Y are affix rules of level 1
      P,L are affix rules of level 2 (that can be applied over level 0 (lemma) and level 1)
      Affix rules of the same level can't mix.