Online Apertium Workshop 2020/Ugly hacks

From Apertium
Jump to navigation Jump to search

I just realised during this whole process that trimming is behind many quality issues in some apertium dix and it can infect other dix even if trimming. Here's a non-exhaustive list of typical things that I've got frustrated and piled ugly hacks on. If you have your own you can please add them here now. This is just to list the type of things we think we are talking about today...

(as a little background, the dev script I use to extend dixes uses non-trim dix so I see these oftener than most)

Where to find them

If you are building your dix well, you can find your ugly hacks by fgrepping for c=


Nobody has time for that, fgrep for LR, RL, <j and so on...


These multiwords I found from eng when debug-adding finnish dictionary:

<e lm="a holiday">       <i>a<b/>holiday</i><par n="house__n"/></e>
<e lm="foreign language"><i>foreign<b/>language</i><par n="house__n"/></e>
<e lm="very strong wind"><i>very<b/>strong<b/>wind</i><par n="house__n"/></e>
<e lm="shortly after">   <i>shortly<b/>after</i><par n="at__pr"/></e>
<e r="RL" lm="shortly after"><i>shortly<b/>after</i><par n="after__cnjadv"/></e>
<e r="LR" lm="that's why"><p><l>that's<b/>why</l><r>that<b/>is<b/>why</r></p><par n="after__cnjadv"/></e>

I can understand sometimes these match one word in one language pair but I would be tempted to call them hacks that kind of are not ideal in monodix that others use any more...


Non-trimming will reveal tons of rarer parses, odd zero-derivations and whatnot...

This should be easy:

echo north | lt-proc eng.automorf.bin 

What's a canonical hack to catch all when developing for fin-eng?

    <e><p><l>pohjoinen<s n="n"/></l><r>north<s n="n"/></r></p></e>
    <e r="RL"><p><l>pohjoinen<s n="n"/></l><r>north<s n="adj"/></r></p></e>
    <e r="RL"><p><l>pohjoinen<s n="n"/><s n="sg"/><s n="ill"/></l><r>north<s n="adv"/></r></p></e>

    <e><p><l>pohjoinen<s n="n"/></l><r>north<s n="n"/></r></p></e>
    <e r="RL"><p><l>pohjoinen<s n="adj"/></l><r>north<s n="adj"/></r></p></e>
    <e r="RL"><p><l>pohjoinen<s n="adv"/></l><r>north<s n="adv"/></r></p></e>

monodix? (Lexc):
pohjoinen+N # ;
pohjoisellinen+Adj # ; ! +Use/MT
pohjoisesti+Adv ! +Use/MT

something else: