I’m working on fixing a bug in the matrix code that makes 1 non-inflecting rule per case-assigning adposition in a grammar. The goal is to have it create one non-inflecting rule that assigns a case value that is underspecified between the possible values an adposition can assign, rather than one per adposition.
In order to do this I need to create a new supertype in the case hierarchy. However, the hierarchies are not exposed to the method that is adding these rules (here’s an excerpt from customize.py, lines 501-526 (with some taken out for conciseness)):
# The following might modify hierarchies in some way, so it's best # to customize those components and only have them contribute their # information to lexical rules when we customize inflection. lexical_items.customize_lexicon( mylang, ch, lexicon, trigger, hierarchies, rules) ... case.customize_case(mylang, ch, hierarchies) # after all structures have been customized, customize inflection, # but provide the methods the components above have for their own # contributions to the lexical rules ... add_lexrules_methods = [case.add_lexrules, argument_optionality.add_lexrules, valence_change.add_lexrules, direct_inverse.add_lexrules, wh_ques.add_lexrules] to_cfv = morphotactics.customize_inflection(ch, add_lexrules_methods, mylang, irules, lrules, lexicon)
So it looks like in the top portion, it does a bunch of customizing for a number of “components," and it’s here that hierarchies can be updated. But then after this when lexical rules are added, the hierarchies don’t get passed on. The method I’m working with is one of these
add_lexrules methods. There are probably a number of ways to go about handling this, but I thought I’d see if anyone had any immediate, obvious suggestions before going into a rabbit hole.