This is a continuation of a prior topic about token-mapping.
A problem that I cannot solve at present is that, for a generic lexical entry that allows both lrule and irule inflections, when I try to parse an inflected form of the LE (i.e. that requires some explicit suffix from an irule), LKB allows the form from the lrule version to pass and enter the phrase rules.
To be more explicit, I have the following type in gle.tdl:
generic_card_ne := numeral-adj-lex &
[ STEM < "_generic_card_ne_" >,
TOKENS.+LIST < [ +CLASS card_ne, +CARG #carg ] >,
SYNSEM.LKEYS.KEYREL.CARG #carg ].
Related tmr definition:
card_ne_2_tmr := basic_ne_tmt &
[ +INPUT < [ +FORM ^([0-9]+)(\-[a-w]+)?$ ] >,
+OUTPUT < [ +CLASS card_ne, +CARG "${I1:+FORM:1}" ] > ].
And tmt definitions:
basic_ne_tmt := one_one_tmt &
[ +INPUT < [ +FORM #form, +CLASS no_class,
+TRAIT [ +LB #lb, +RB #rb, +LD #ld, +RD #rd ],
+PRED #pred, +CARG #carg] >,
+OUTPUT < [ +FORM #form, +CLASS named_entity,
+TRAIT [ +LB #lb, +RB #rb, +LD #ld, +RD #rd ],
+PRED #pred, +CARG #carg ] >,
+CONTEXT <> ].
basic_one_one_tmt := token_mapping_rule &
[ +INPUT.FIRST [ +ID #id, +FROM #from, +TO #to ],
+OUTPUT.FIRST [ +ID #id, +FROM #from, +TO #to ] ].
one_one_tmt := basic_one_one_tmt &
[ +INPUT < [] >,
+OUTPUT < [] >,
+POSITION "O1@I1" ].
numeral-adj-lex can go through the following irules
pl_abs_attr_adj-suffix :=
%suffix (* -t)
pl_abs_attr_adj-lex-rule.
sg_erg_attr_adj-suffix :=
%suffix (* -p)
sg_erg_attr_adj-lex-rule.
pl_erg_attr_adj-suffix :=
%suffix (* -t)
pl_erg_attr_adj-lex-rule.
sg_ins_attr_adj-suffix :=
%suffix (* -mik)
sg_ins_attr_adj-lex-rule.
pl_ins_attr_adj-suffix :=
%suffix (* -nik)
pl_ins_attr_adj-lex-rule.
sg_incorp_real_v_attr_adj-suffix :=
%suffix (* -mik)
sg_incorp_real_v_attr_adj-lex-rule.
pl_incorp_real_v_attr_adj-suffix :=
%suffix (* -nik)
pl_incorp_real_v_attr_adj-lex-rule.
pl_incorp_npred_attr_adj-suffix :=
%suffix (* -t)
pl_incorp_npred_attr_adj-lex-rule.
;;;mod [TODO: choices]
sg_loc_attr_adj-suffix :=
%suffix (* -mi)
sg_loc_attr_adj-lex-rule.
pl_loc_attr_adj-suffix :=
%suffix (* -ni)
pl_loc_attr_adj-lex-rule.
;;;endmod
And the following lrules:
sg_abs_attr_adj-lex := sg_abs_attr_adj-lex-rule.
sg_incorp_npred_attr_adj-lex := sg_incorp_npred_attr_adj-lex-rule.
Now I try to parse “15-nik”. I can see from the LKB parse chart that the generic lexical entry with CARG “15” can pass pl_ins_attr_adj-suffix (-nik) and cannot pass e.g., pl_erg_attr_adj-suffix (-p), which is expected. However, surprisingly, it can pass the lrule sg_abs_attr_adj-lex and then directly enter a unary phrase rule without being killed. sg_abs_attr_adj-lex is not the daugher of any futher lexical rules (including both irules and lrules).
What should I do to rule out lrule applications that do not respect the original form with inflections? I cannot find a good example from ERG to start with, as numerals with a trailing s (like “1990s”) are directly captured in whole as plur_ne, and token-mapping classifies invented nouns in, e.g. “there are two 404s”, as a singular generic_proper_ne that goes through n_sg_ilr, not a unk with plural inflection.