Skip to content

Commit

Permalink
Resolve #87; Change DMRS bare /EQ links to MOD/EQ
Browse files Browse the repository at this point in the history
  • Loading branch information
goodmami committed Jan 11, 2017
1 parent 1ac5f52 commit a2f1149
Show file tree
Hide file tree
Showing 5 changed files with 189 additions and 122 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ accomplishes the same thing).
* `delphin.extra.latex` has nicer looking DMRS output
* Quantifiers are detected more consistently for, e.g., DMRS conversion;
this mostly resolves #84
* DMRS `/EQ` links are now `MOD/EQ` and fix a direction (resolves #87)

### Fixed

Expand Down
5 changes: 3 additions & 2 deletions delphin/mrs/components.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
from .config import (
IVARG_ROLE, CONSTARG_ROLE, RSTR_ROLE,
UNKNOWNSORT, HANDLESORT, CVARSORT, QUANTIFIER_POS,
EQ_POST, HEQ_POST, NEQ_POST, H_POST
EQ_POST, HEQ_POST, NEQ_POST, H_POST,
BARE_EQ_ROLE
)

# The classes below are generally just namedtuples with extra methods.
Expand Down Expand Up @@ -298,7 +299,7 @@ def links(xmrs):
if len(heads) > 1:
first = heads[0]
for other in heads[1:]:
links.append(Link(first, other, None, post=EQ_POST))
links.append(Link(other, first, BARE_EQ_ROLE, EQ_POST))
# If not, something like this is more explicit
# lblset = self.labelset(lbl)
# sg = g.subgraph(lblset)
Expand Down
1 change: 1 addition & 0 deletions delphin/mrs/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@
H_POST = 'H'
NIL_POST = 'NIL'
CVARSORT = 'cvarsort'
BARE_EQ_ROLE = 'MOD'
6 changes: 3 additions & 3 deletions tests/mrs_components_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from delphin.mrs.config import (
CVARSORT, IVARG_ROLE, CONSTARG_ROLE, RSTR_ROLE,
EQ_POST, HEQ_POST, NEQ_POST, H_POST, NIL_POST,
LTOP_NODEID, FIRST_NODEID
LTOP_NODEID, FIRST_NODEID, BARE_EQ_ROLE
)


Expand Down Expand Up @@ -265,10 +265,10 @@ def test_links():
assert sorted(links(x5)) == [
(0, 10006, None, 'H'),
(10000, 10001, 'RSTR', 'H'),
(10001, 10005, None, 'EQ'),
(10002, 10004, 'RSTR', 'H'),
(10003, 10001, 'ARG2', 'EQ'),
(10003, 10004, 'ARG1', 'NEQ'),
(10005, 10001, BARE_EQ_ROLE, 'EQ'),
(10005, 10004, 'ARG1', 'NEQ'),
(10006, 10001, 'ARG1', 'NEQ')
]
Expand All @@ -280,8 +280,8 @@ def test_links():
(10002, 10001, 'L-INDEX', 'NEQ'),
(10002, 10003, 'R-HNDL', 'HEQ'),
(10002, 10003, 'R-INDEX', 'NEQ'),
(10002, 10004, BARE_EQ_ROLE, 'EQ'),
(10003, 10004, 'ARG1', 'NEQ'),
(10004, 10002, None, 'EQ'),
(10005, 10004, 'ARG1', 'NEQ')
]

Expand Down
Loading

0 comments on commit a2f1149

Please sign in to comment.