Adding a homonymous lexical rule but not seeing it in the chart

Here I am after 10 years of grammar engineering :sweat_smile:

This must be something very simple. I have a tiny grammar, should be very easy to look at and investigate (it’s a debugging subgrammar of the SRG). The only quirk is that the “inflectional rules” in this grammar are associated with the external morphophonological analyzer tags, e.g.:

ncfs000 := 
%suffix (ncfs000 ncfs000)
n_fem-sg_ilr.

This means, the input is expected in YY mode and it will contain the word and its Freeling tag which, for this rule to apply, should be ncfs000. What may be confusing is the way the rule is defined as inflecting but there not being any actual change in the orthography, but that is because of the external analyzer.

Now, I want to add another rule which would also be triggered by the exact same tag ncfs000. I thought it should be possible by simply adding:

ncfs000mal := 
%suffix (ncfs000 ncfs000)
n_fem-sg-mal_ilr.

and then the corresponding definition for n_fem-sg-mal_ilr.

If I do that, I see the rule among the possible rules in the grammar when I load it, say, into the LKB but I do not see it in the chart. (In ACE neither; the only edge I see in the chart is the one with the original rule.)

I can create an edge interactively but in the chart below, the N[19] is the original n_fem-sg_ilr.:

What could be the reason? I reviewed the UnifySurprise list but I am not sure how to procede.

Just in case it is relevant, I have the single lexical filtering rule:

generic_non_ne+native_lfr := lexical_filtering_rule &
 [ +CONTEXT < [ TRAITS native_token_list ] >,
   +INPUT   < [ TRAITS generic_token_list ] >,
   +OUTPUT < >,
   +POSITION "I1@C1" ].

How are the rules triggered, given the external morphological analyzer? Is that set up one that allows for homophony? (And are you sure homophony is the right analysis here?)

As a kind of reality check – what happens if you make it non-homophonous?

1 Like

Good question; I don’t know! They are triggered somehow using the YY machinery…

(And are you sure homophony is the right analysis here?)

Well, I’d like to try. I am experimenting with ways to model mal rules without doubling e.g. the entire lexicon (for gender agreement errors). I thought perhaps I could have the “inflectional rule” which sets the gender value do that work. It would have to be associated with the same tag as the normal one.

I can get to a unification failure if I continue building the edges that I expect interactively; maybe the LKB is smart enough to filter out things which will not be successful later? But I don’t think I am seeing that in the known list… (Then again, I don’t fully understand some of the items there…)

After making a change that was previously causing a unification failure upstream, I am able to interactively build the full parse… But I don’t see the new lexical rule in the chart.

ACE gives me the following:

...
...
[#17 [lex 1 orth 0x600045cd10] + #9 [lex 0x6000469014]] rule ncfs000mal?
[#18 [lex 1 orth 0x6000460e10] + #9 [lex 0x6000469014]] rule ncfs000?
trying: #9 n_-_m_native_le in #18 *top*[0]
generated #23 1/1 from #18, #9 for [3-4] with rule ncfs000: cara

So, looks like it tried both but picked strictly one?.. Not sure what this means.

If I comment out the regular rule and only leave in the new one, the parser (LKB in this case) complains that it wants the rule with a name that corresponds exactly to the tag, looks like:

Screenshot from 2023-12-12 17-19-26

So, maybe the setup does not allow homophonous rules?..

It looks like the solution would be once more at the level of the Freeling interface.

If I have two rules:

ncfs000mal := 
%suffix (ncfs000mal ncfs000mal)
n_fem-sg-mal_ilr.

ncfs000 := 
%suffix (ncfs000 ncfs000)
n_fem-sg_ilr.

And then augment the YY input with an additional edge:

(5, 3, 4, <14:18>, 1, "cara" "cara", 0, "ncfs000", "ncfs000" -1)(6, 3, 4, <14:18>, 1, "cara" "cara", 0, "ncfs000mal", "ncfs000mal" -1)

Then I get the parse.