-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
format function for TypeDefinition seems to mess up some of the Lists #357
Comments
Repro:
|
Ok thanks, I've confirmed the bug. I'm trying to figure out what to do about it. In cons-lists, the final item being delimited by a dot
For debugging I modified your main-vprn := basic-main-verb & norm-pronominal-verb &
[ SYNSEM.LOCAL.CAT.VAL [ SUBJ < #subj >,
COMPS < #comps >,
CLTS #clt ],
ARG-ST < #subj . < #comps . #clt > > ].
main-vprn2 := basic-main-verb & norm-pronominal-verb &
[ SYNSEM.LOCAL.CAT.VAL [ SUBJ < #subj >,
COMPS < #comps >,
CLTS #clt ],
ARG-ST < #subj , #comps . #clt > ]. The first thing I notice is that the value of >>> from delphin import tdl
>>> orig, mod = [obj for _, obj, _ in tdl.iterparse('debug.txt')]
>>> orig['ARG-ST'].features()
[('FIRST', <Coreference object at 139968742236480>), ('REST', <ConsList object at 139968744179648>)]
>>> mod['ARG-ST'].features()
[('FIRST', <Coreference object at 139968742237344>), ('REST', <AVM object at 139968740017344>)] The features of these AVMs are the same, though (I need to cast the >>> str(orig['ARG-ST.FIRST']) == str(mod['ARG-ST.FIRST'])
True
>>> str(orig['ARG-ST.REST.FIRST']) == str(mod['ARG-ST.REST.FIRST'])
True
>>> str(orig['ARG-ST.REST.REST']) == str(mod['ARG-ST.REST.REST'])
True Also note that PyDelphin has no problem formatting the modified version: >>> print(tdl.format(mod))
main-vprn2 := basic-main-verb & norm-pronominal-verb &
[ SYNSEM.LOCAL.CAT.VAL [ SUBJ < #subj >,
COMPS < #comps >,
CLTS #clt ],
ARG-ST < #subj, #comps . #clt > ]. I think PyDelphin should be able to recreate the dotted form since it knows the value of |
This required a new (non-public) type: _ImplicitAVM. This is the AVM constructed by list syntax (< ... > or <! ... !>).
If I
iterparse
this TypeDefinitionand then print it back out using the
format
function, I get this:The text was updated successfully, but these errors were encountered: