delph-in / pydelphin

Python libraries for DELPH-IN
https://pydelphin.readthedocs.io/
MIT License
79 stars 27 forks source link

Allow identifiers on EDS serializations #323

Closed goodmami closed 3 years ago

goodmami commented 3 years ago

Following the discussion here, a native-serialized EDS should be able to have an optional identifier:

#4711
{e2:
 e2:_bark_v_1{e}[ARG1 x4]
 _1:udef_q[BV x4]
 x4:_dog_n_1{x}[]
}

SimpleDMRS, for instance, already has this:

>>> from delphin.codecs import simpledmrs
>>> from delphin.dmrs import DMRS, Node, Link
>>> d = DMRS(1, nodes=[Node(1, '_rain_v_1', 'e')], links=[], identifier='4711')
>>> print(simpledmrs.encode(d))
dmrs 4711 { [top=1] 1 [_rain_v_1 e]; }