Problems with a match
Closed this issue · 7 comments
In apertium-fra-cat we have the file apertium-fra-cat.cat-fra.l2x
There are several rules which are more or less a copy-and-paste but none of them has been tested.
I've tried with the rule "rendre public", which is supposed to split the multiword "rendre# public" if it is followed by "pas" changing "rendre public pas" into "rendre pas public". Unfortunately it doesn't work:
> no faig públic.
> ^no/no<adv>$ ^faig públic/fer<vblex><pri><p1><sg># públic$^./.<sent>$
> ^no/no<adv>$ ^faig públic/fer# públic<vblex><pri><p1><sg>$^./.<sent>$
> ^no<adv>$ ^fer# públic<vblex><pri><p1><sg>$^.<sent>$
> ^no<adv>/ne<adv>/non<adv>$ ^fer# públic<vblex><pri><p1><sg>/rendre# public<vblex><pri><p1><sg>$^.<sent>/.<sent>$
> ^no<adv>/ne<adv>$ ^fer# públic<vblex><pri><p1><sg>/rendre# public<vblex><pri><p1><sg>$^.<sent>/.<sent>$
> ^ne<adv>$ ^rendre<vblex><pri><p1><sg># public$ ^pas<adv>$^.<sent>$
> ~ne rends public pas~.
> ne rends public pas.
I've tried several possibilities of matching, but I couldn't make the rule work (there are two rules now, just as a try: there is no match).
Any help would be appreciated.
@irene-tang @jonorthwash any ideas, I thought this was already fixed?
@hectoralos, I think more info is needed to understand what's going on. Could you share the rule you're expecting to work, the command you're using to compile it, input at that stage only, and actual and expected output?
You are right, @jonorthwash.
The input is:
^ne<adv>$ ^rendre<vblex><pri><p1><sg># public$ ^pas<adv>$
The expected output is:
^ne<adv>$ ^rendre<vblex><pri><p1><sg>$ ^pas<adv>$ ^public<n><m><sg>$
The original rule is:
<e lm="rendre public" c="">
<p><l>rendre<g><b/>public</g><s n="vblex"/></l><r>rendre<s n="vblex"/></r></p>
<i><t/><j/></i>
<p><l></l><r>pas<s n="adv"/><j/></r></p>
<p><l></l><r>public<s n="n"/><s n="m"/><s n="sg"/><j/></r></p>
<p><l>pas<s n="adv"/><j/></l><r></r></p>
</e>
I have try different other possibilities. The last one was:
<e lm="rendre public" c="">
<p><l>rendre<s n="vblex"/><t/><g><b/>public</g><j/></l><r>rendre<s n="vblex"/><t/><j/></r></p>
<p><l></l><r>pas<s n="adv"/><j/></r></p>
<p><l></l><r>public<s n="n"/><s n="m"/><s n="sg"/><j/></r></p>
<p><l>pas<s n="adv"/><j/></l><r></r></p>
</e>
@hectoralos, and how did you compile the transducer?
@jonorthwash, I am not sure if I understand your question. I've done this, maybe it is want you are asking for:
> touch apertium-fra-cat.cat-fra.l2x
> make
lsx-comp rl apertium-fra-cat.cat-fra.l2x cat-fra.autosep.bin
main@standard 230 246
@hectoralos, I've found out why it was not working.
I'm assuming you really wanted to say lr
and not rl
when compiling (as you want to break rendre public
and not join it).
This is the rule
<e lm="rendre public">
<p><l>rendre<s n="vblex"/><t/><g><b/>public</g><j/></l><r>rendre<s n="vblex"/><t/><j/></r></p>
<i>pas<s n="adv"/><j/></i>
<p><l></l><r>public<s n="n"/><s n="m"/><s n="sg"/><j/></r></p>
</e>
As you see, the main difference is where tags are located in the multiword rendre public
. They go before the group tag <g>
, and not after.
I've also simplifed pas<adv>
in the rule, as it didn't need that complexity.
$ echo '^ne<adv>$ ^rendre<vblex><pri><p1><sg># public$ ^pas<adv>$' | lsx-proc test.lsx.bin
^ne<adv>$ ^rendre<vblex><pri><p1><sg>$ ^pas<adv>$ ^public<n><m><sg>$
Great, @xavivars ! It's working now. And I better understand how the module works. Thank you very much!