Closed arademaker closed 3 years ago
Moreover, the warn message is confusing. The warnings.warn(
is not closed! Maybe it is mixing the STDERR and STDOUT outputs?
Maybe it is already doing the right thing, just ignoring one edge in the DMRS.. but the warning is strange.
After @goodmami directions, we maybe @yfaria @FredsoNerd
The warnings.warn(
thing is a Python thing that shows the line that issued the warning. It looks better when the full warning fits on one line:
$ cat warns.py
import warnings
warnings.warn('caution!')
warnings.warn(
'caution on the next line'
)
$ python3 warns.py
warns.py:2: UserWarning: caution!
warnings.warn('caution!')
warns.py:3: UserWarning: caution on the next line
warnings.warn(
I don't think there's anything practical that I can do about that. The warnings should be printed to stderr:
$ cat z.mrs
[ TOP: h0 INDEX: e3 [ e TENSE: past ]
RELS: < [ _rain_v_1 LBL: h2 ARG0: e3 ] >
HCONS: < > ]
$ delphin convert -t dmrx z.mrs
/home/goodmami/delphin/pydelphin/delphin/dmrs/_operations.py:81: DMRSWarning: unusable TOP: h0
warnings.warn(f'unusable TOP: {top_var}', dmrs.DMRSWarning)
<dmrs-list>
<dmrs cfrom="-1" cto="-1" index="10000">
<node nodeid="10000" cfrom="-1" cto="-1"><realpred lemma="rain" pos="v" sense="1" /><sortinfo TENSE="past" cvarsort="e" /></node>
</dmrs>
</dmrs-list>
$ delphin convert -t dmrx z.mrs 2>/dev/null
<dmrs-list>
<dmrs cfrom="-1" cto="-1" index="10000">
<node nodeid="10000" cfrom="-1" cto="-1"><realpred lemma="rain" pos="v" sense="1" /><sortinfo TENSE="past" cvarsort="e" /></node>
</dmrs>
</dmrs-list>
Is that not the case for you?
It looks like there's nothing wrong with PyDelphin here, so I'm closing the issue as invalid.
The conversion from MRS to DMRS fails with errors. It seems the error is the same of #319
The profiles are https://www.dropbox.com/s/pbs1qgb8ih2uywl/profiles.zip?dl=0. The code for reproducing is
Can we make the transformation more robust? In the MRS above, the error is that h16 does not occurs in the predications, right? In such case, we could just ignore the this specific constraint
h15 qeq h16
?Should we open an issue in the ERG repo?