delph-in / pydelphin

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

Single-quoted symbols in SimpleMRS are not fully read in #373

Closed goodmami closed 8 months ago

goodmami commented 8 months ago

From https://github.com/delph-in/pydelphin/issues/371#issuecomment-1818266129

The legacy single-quoted symbols like ('null_coord_rel) are only being parsed with a single letter:

>>> m = simplemrs.decode("[RELS: < [ 'null_coord_rel LBL: h0 ARG0: e2 ] >]")
[...]
delphin.mrs._exceptions.MRSSyntaxError: 
  line 1, character 13
    [RELS: < [ 'null_coord_rel LBL: h0 ARG0: e2 ] >]
                 ^
MRSSyntaxError: expected: a feature
>>> m = simplemrs.decode("[RELS: < [ 'n LBL: h0 ARG0: e2 ] >]")
>>> m.rels[0].predicate
'n'