Hunspell- Two affix rule with a compound rule

Help
2007-10-07
2013-06-03
  • Esben Aaberg
    Esben Aaberg
    2007-10-07

    Hello

    We are having some problem combining two affix rule with a compound rule.

    In Hunspell is it allowed to make a compound-rule with two affixes,  like this:
    (prefix)?(root)+(affix)+(affix)?

    Where the first affix-rule is a NEEDAFFIX-rule!

    http://sourceforge.net/docman/display_doc.php?docid=29374&group_id=143754#Compounds

    Simplified example whit Danish words:
    under
    hus huset (affix rule 1 = add "et")
    stel stellet (affix rule 2 = add "l" and affix rule 1)
    underhuset (compund + affix)
    understellet (compund + affix + affix)

    I know there is a workaround by making affix rule 2 more complex, so it includes all the rules from affix rule 1 too, but if can we avoid it we would prefer it.

    Regards

    Esben Aaberg
    www.stavekontrolden.dk

     
    • Hello,

      Could you attach your aff and dic files? Thanks in advance.

      Laci

       
    • Børre Gaup
      Børre Gaup
      2008-12-17

      I have a similar problem, where I am trying to make hunspell recognise compounds like these:
      stem + clitic
      stem + affix + clitic
      stem + affix + affix + clitic

      The .dic file looks like this:
      5
      # Word that needs an affix
      barggah/BE
      # Word that can be standalone or take the suffixes in A
      barga/A
      # Propernoun
      Jonas/D
      # These are clitics
      # They are allowed to appear either alone, or as the last part
      # of a compound, as specified in the compounding rule
      ban/C
      go/C

      The .aff file looks like this:
      SET UTF-8

      NEEDAFFIX E
      COMPOUNDFLAG F
      COMPOUNDPERMITFLAG H
      COMPOUNDBEGIN G
      COMPOUNDMIN 2

      COMPOUNDRULE 1
      COMPOUNDRULE DC

      SFX A Y 2
      SFX A 0 lin/HG . VI
      SFX A 0 lit/D . VI

      SFX B Y 1
      SFX B 0 atta/EFA .

      Accepted words are:
      barggahattalin
      barggahattalit
      ban
      go
      bargalin
      bargalit
      Jonasban
      Jonasgo
      bargalinbarggahattalin
      barga

      Words that are not accepted, that I thought these rules would allow:
      bargalitban
      bargalitgo
      barggahattalitban
      barggahattalitgo

      Are there any obvious defects in my rules?

      Another question: why isn't barggahattalinbarggahattalin a recognised as a valid compound, but bargalinbarggahattalin is?
      Principally barggahattalin is the same type of word as bargalin, isn't it?

      Regards,
      Børre Gaup
      http://divvun.no