Editing morphotactics.py

I’m working on an adnominal possession library, and I need to implement lexical rules that inflect the possessor or possessum. In my sandbox version of the questionnaire, I have an adnominal possession subpage: http://matrix.ling.washington.edu/ekayen/matrix.cgi?subpage=adnom-poss. When the user indicates on this page that one of their possessive strategies involves some affix, a ‘possessor’ or ‘possessum’ pseudofeature is created on the morphology page. The idea is that when a rule on the morphology page is marked (for example) [POSSESSOR plus], the matrix will generate the appropriate possessor-marking lexical rule. However, there’s also a lot of info that’s entered on the adnominal possession page that affects what the rule will look like. In general, I’d like to do most of the work within my own library file, but I imagine I can’t do all of it there. I wanted to see if people who have written libraries that added lexical rules (possibly Chris?) have developed a good strategy for what goes in morphotactics.py vs. what goes in their own library.


You might find my code in nominalized_clauses.py useful (which you can find in my branch (kphowell)). I followed what Joshua did in the negation library, so you can look there too. Lines 5-18 in nominalized_clauses.py check to see if a nominalization feature is on any of the lexical rule types and if it is, a nominalized-lex-rule supertype is added to the supertypes of that lexical rule type. Then I can define that supertype based on the nominalized clauses choices.

If that’s what you’re trying to do and you have follow up questions, let me know!

1 Like

My strategy is that valence_change.py has all the code that builds the rules out of component parts; there’s a function in morphotactics.py that calls into it and writes out the actual LRT the questionnaire input asked for. (There are still some supertypes that I add in morphotactics that should probably be in my library instead, if you look there and are confused.)

The rough division is that all the logic for how to create the rules – possibly including the rule name – goes in the library; morphotactics only worries about wiring up the position classes and rule types.

1 Like