Skip to content
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

Quote predicates containing reserved characters in SimpleMRS #372

Closed
goodmami opened this issue Nov 28, 2023 · 0 comments
Closed

Quote predicates containing reserved characters in SimpleMRS #372

goodmami opened this issue Nov 28, 2023 · 0 comments

Comments

@goodmami
Copy link
Member

From #371 (comment)

In SimpleMRS, when a string-pred containing reserved characters (whitespace, <, [, etc.) is read in, it will be serialized without quotes, leading to a form that can't be decoded again.

>>> m = simplemrs.decode('[RELS: < [ "foo bar" LBL: h0 ARG0: e2 ] >]')
>>> print(simplemrs.encode(m))
[ RELS: < [ foo bar LBL: h0 ARG0: e2 ] > ]
>>> simplemrs.decode(simplemrs.encode(m))
[...]
delphin.mrs._exceptions.MRSSyntaxError: 
    [ RELS: < [ foo bar LBL: h0 ARG0: e2 ] > ]
                    ^
MRSSyntaxError: expected: a feature

On serialization, the predicates should be checked for the presence of such characters. If the characters are present, the predicate should be quoted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant