<div dir="ltr"><p class="gmail_msg">Jacy sometimes returns parses with ill-formed MRSs. This particular bug is already noted (<a href="https://github.com/delph-in/jacy/issues/1" class="gmail_msg" target="_blank">https://github.com/delph-in/jacy/issues/1</a>), but unfortunately hasn't been fixed yet.</p><p class="gmail_msg">PyDelphin only throws a warning because it can still work with the MRS in some ways, but, as Guy noted, DMRS conversion is not guaranteed for all MRSs. Generally, well-formed MRSs are convertible, but there is a subset of "well-formed" MRSs that are not. We have discussed updating the well-formedness criteria, but have not fully done so. For more information, see the following:</p><p class="gmail_msg"><a href="http://moin.delph-in.net/RmrsWellformedness">http://moin.delph-in.net/RmrsWellformedness</a><br></p><p class="gmail_msg">And the following are minutes of discussions with more information and examples, but it may be hard to follow:</p><p class="gmail_msg"><a href="http://moin.delph-in.net/TomarMrsWellformedness">http://moin.delph-in.net/TomarMrsWellformedness</a><br><a href="http://moin.delph-in.net/SingaporeMrsWellformedness">http://moin.delph-in.net/SingaporeMrsWellformedness</a></p><p class="gmail_msg">How are you using PyDelphin for the conversion? If you are using it as a library (rather than converting at the command line), it may be possible to capture the warning you've seen so you can skip the item altogether, rather than potentially dealing with errors downstream. E.g.:</p><p class="gmail_msg">>>> from delphin.mrs import dmrx<br>>>> from delphin.interfaces import ace<br>>>> from delphin.exceptions import XmrsWarning<br>>>> import warnings<br>>>><br>>>> def get_dmrs(sentence, grm):<br>... with warnings.catch_warnings():<br>... warnings.filterwarnings('error')<br>... try:<br>... return dmrx.dumps_one(ace.parse(grm, sentence).result(0).mrs())<br>... except XmrsWarning:<br>... return None<br>... <br>>>> grm = '/home/goodmami/grammars/jacy/jacy.dat'<br>>>> print(get_dmrs('その 部屋 は あまり 静か じゃ ない です 。', grm))<br>Exception ignored in: <_io.FileIO name=5 mode='rb' closefd=True><br>ResourceWarning: unclosed file <_io.TextIOWrapper name=5 encoding='UTF-8'><br>None<br>>>> print(get_dmrs('その 部屋 は あまり 静か です 。', grm))<br>Exception ignored in: <_io.FileIO name=5 mode='rb' closefd=True><br>ResourceWarning: unclosed file <_io.TextIOWrapper name=5 encoding='UTF-8'><br><dmrs-list><dmrs cfrom="-1" cto="-1">[...]</p>
<div>(You can ignore the Exception and ResourceWarning in the last two commands.)</div><div>Note that the first one (that has causes the XmrsWarning you noticed) returns None, while the second (without the negation causing the problem) returns the DMRS as expected.</div><div><br></div><div class="gmail_quote gmail_msg"><div dir="ltr" class="gmail_msg">On Thu, Nov 10, 2016, 06:27 Guy Emerson <<a href="mailto:gete2@cam.ac.uk" class="gmail_msg" target="_blank">gete2@cam.ac.uk</a>> wrote:<br class="gmail_msg"></div><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg">I cannot comment on Jacy, but you should be aware that not all MRSs can be converted to DMRS. If you would like to generate from an MRS that is not DMRS-compatible, then you should not try to convert the MRS to DMRS and back.<br class="gmail_msg"><br class="gmail_msg"></div>An important constraint for an MRS to be DMRS-compatible is that each variable can only be the intrinsic variable of a single EP.<br class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div></div><div class="gmail_extra gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg">2016-11-10 12:22 GMT+00:00 Naman Deep Singh <span dir="ltr" class="gmail_msg"><<a href="mailto:nmndeep@gmail.com" class="gmail_msg" target="_blank">nmndeep@gmail.com</a>></span>:<br class="gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg"><div class="gmail_msg">Sir,<br class="gmail_msg"></div>The segmentation issue was resolved<br class="gmail_msg"></div>But,<br class="gmail_msg"><br class="gmail_msg"></div>Whilst running this particular sentence:<br class="gmail_msg"> その部屋はあまり静かじゃないです。<br class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">The ACE generated MRS has "ARG0: e2" for two different attributes as in (inp.mrs)<br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"></div>When we try to generate DMRS from ACE generated MRS of this sentence a warning error is shown :<br class="gmail_msg"><br class="gmail_msg">/home/naman/.local/lib/python2.7/site-packages/delphin/mrs/simplemrs.py:244: XmrsWarning: e2 is the intrinsic variable for more than one EP.<br class="gmail_msg"> warn(str(ex), XmrsWarning)<br class="gmail_msg"><br class="gmail_msg"></div>Now on reverse generation of the sentence via the MRS generated from the DMRS the same error prompts up and sentence generation is failed.<br class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">Please look into the problem.<br class="gmail_msg"></div>With Regards<br class="gmail_msg"></div>
</blockquote></div><br class="gmail_msg"></div>
</blockquote></div></div>