jflanigan / jamr

JAMR Parser and Generator
BSD 2-Clause "Simplified" License
193 stars 50 forks source link

slash in token results in malformed AMR #38

Open esmanning opened 5 years ago

esmanning commented 5 years ago

When parsing sentences containing the token '24/7', the JAMR parser returned AMRs with things like:

:ARG1 24/7

Which results in errors when attempting to further process these AMRs; for example, when running smatch, it returns the error:

Traceback (most recent call last): File "smatch.py", line 927, in main(args) File "smatch.py", line 827, in main amr1.rename_node(prefix1) AttributeError: 'NoneType' object has no attribute 'rename_node'

This can be avoided by adding quotation marks in the parser output to treat the problematic token as a string, e.g.

:ARG1 "24/7"

Which appears to be the approach used in gold AMR data.