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

isomorphism() uses unnnormalized predicate strings #133

Closed
goodmami opened this issue Jan 29, 2018 · 0 comments
Closed

isomorphism() uses unnnormalized predicate strings #133

goodmami opened this issue Jan 29, 2018 · 0 comments
Assignees
Milestone

Comments

@goodmami
Copy link
Member

Isomorphism still relies on unnormalized predicate strings. Compare the following where s1 and s2 only differ by the presence of _rel at the end of the predicates:

>>> from delphin.mrs import simplemrs, compare
>>> s1
'[ LTOP: h0 INDEX: e2 [ e SF: prop TENSE: past MOOD: indicative PROG: - PERF: - ] RELS: < [ proper_q<0:6> LBL: h4 ARG0: x3 [ x PERS: 3 NUM: sg IND: + ] RSTR: h5 BODY: h6 ]  [ named<0:6> LBL: h7 CARG: "Abrams" ARG0: x3 ]  [ _sleep_v_1<7:13> LBL: h1 ARG0: e2 ARG1: x3 ] > HCONS: < h0 qeq h1 h5 qeq h7 > ]'
>>> s2
'[ LTOP: h0 INDEX: e2 [ e SF: prop TENSE: past MOOD: indicative PROG: - PERF: - ] RELS: < [ proper_q_rel<0:6> LBL: h4 ARG0: x3 [ x PERS: 3 NUM: sg IND: + ] RSTR: h5 BODY: h6 ]  [ named_rel<0:6> LBL: h7 CARG: "Abrams" ARG0: x3 ]  [ _sleep_v_1_rel<7:13> LBL: h1 ARG0: e2 ARG1: x3 ] > HCONS: < h0 qeq h1 h5 qeq h7 > ]\n\n'
>>> x1 = simplemrs.loads_one(s1)
>>> x2 = simplemrs.loads_one(s2)
>>> x1 == x2  # generally a stricter test than isomorphism
True
>>> compare.isomorphic(x1,x2)
False
>>> compare.isomorphic(x1,x1)
True
>>> compare.isomorphic(x2,x2)
True

compare.isomorphic() should use pred.short_form() instead of pred.string

@goodmami goodmami added this to the v0.8.0 milestone Aug 6, 2018
mcmillanmajora added a commit that referenced this issue Aug 8, 2018
Tests were put in a separate file. They are now relocated to the file
with the other delphin.mrs.compare tests.
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

2 participants