delph-in / matrix

The Grammar Matrix

Home Page:https://matrix.ling.washington.edu/index.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Valence-change library: passive constructions incorrect number of arguments.

KerenR3 opened this issue · comments

The rules generated for the subj-demoting and obj-promoting operations seem to be assuming the wrong number of arguments when the input for these operations is transitive.

When the input to these operations is transitive, the rules assume three arguments:

    verb-pc1_lrt4_name=passive
      verb-pc1_lrt4_valchg1_operation=subj-dem
      verb-pc1_lrt4_valchg1_inputs=trans
      verb-pc1_lrt4_valchg2_operation=obj-prom
      verb-pc1_lrt4_valchg2_inputs=trans
      verb-pc1_lrt4_lri1_inflecting=yes
      verb-pc1_lrt4_lri1_orth=-ed
subj-dem-to-arg3of3-op-lex-rule := subj-and-comps-change-only-lex-rule &
  [ SYNSEM.LOCAL.CAT.VAL.COMPS < #oarg,
                                 [ LOCAL.CONT.HOOK.INDEX #sidx ] >,
    DTR.SYNSEM.LOCAL.CAT.VAL [ SUBJ < [ LOCAL.CONT.HOOK.INDEX #sidx ] >,
                               COMPS < #oarg,
                                       [ ] > ] ].

obj-prom-from-arg3of3-op-lex-rule := subj-and-comps-change-only-lex-rule &
  [ SYNSEM.LOCAL.CAT.VAL [ SUBJ < [ LOCAL.CONT.HOOK.INDEX #sidx ] >,
                           COMPS < #oarg,
                                   [ ] > ],
    DTR.SYNSEM.LOCAL.CAT.VAL.COMPS < #oarg ,
                                     [ LOCAL.CONT.HOOK.INDEX #sidx ] > ].

This seems to be the result of the fact that within the valence change library when both obj-prom and subj-dem rules are added to language.tdl, they are called along with the argnum and numargs parameters:

                elif opname == 'subj-dem':
                    rules.add('subj-dem-op', argnum, numargs)
                elif opname == 'obj-prom':
                    rules.add('obj-prom-op', argnum, numargs)

These parameters in turn come from the following function within the library, which sets the numargs to 3 if transitive and to 2 otherwise:

def added_argnum_for_vchop(vchop):
    position = vchop.get('argpos', 'post').lower()  # default to post
    inputs = vchop.get('inputs', '').split(',')
    transitive = 'trans' in inputs or (
        len(inputs) == 1 and inputs[0] == '')  # default to transitive
    numargs = 3 if transitive else 2
    argnum = numargs - (1 if (transitive and position == 'pre') else 0)
    return (argnum, numargs)

This results in passive constructions (for the attached choices file) not being parsed. Additionally, when the input to both the larger position class and the valence changing operation is transitive it leads to compilation errors:

verb-pc2_name=valence-changing
 verb-pc2_order=suffix
 verb-pc2_inputs=tverb
   verb-pc2_lrt1_name=passive-tr
     verb-pc2_lrt1_valchg1_operation=subj-dem
     verb-pc2_lrt1_valchg1_inputs=trans

image

pass-trans-choices.txt

jpn-pass-does-not-compile.txt

Thank you for documenting this, @KerenR3 ! @curtosis --- anything jump out at you that we should keep in mind while fixing this?

@emilymbender @KerenR3 Nothing in particular to watch out for, I don't think, and those choices files look correct to me.

On a brief delve, it looks like that is indeed a bug: obj-prom-op and subj-dem-op shouldn't be using the added argnum. I don't see anything obvious in the history that would have broken it, though; it could very well be a schrödingbug.

The only other thing that I can think of that's really changed is the change over to append-lists (commit 25e4fa0?). Nothing there looks like it should matter, but the details of picking out which argument goes where are a bit finicky, and so there may be a stray append or constraint that rolled under the metaphorical couch.

Thank you, @curtosis -- those are helpful breadcrumbs!