<div><div class="gmail_msg">dear all,</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">no need to add VPM rules which unconditionally delete: that will be the default behavior for any variable properties for which no mapping is defined. mike, could you update your addition to RmrsVpm in this light?</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">however, GG has explicit VPM rules for --PSV and several others that start in double hyphens, so it would seem berthold actually wants these in the external interface.</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">i too was under the impression that the double-hyphen prefix typically indicates something grammar-internal, but that could just be an ERG-specific convention.</div><div class="gmail_msg"><br></div><div class="gmail_msg">either way, it would seem sad to formally disallow initial hyphens in MRS variable properties because they cause problems for some serializations of some derived representations. i would rather look for a backwards-compatible extension of the DMRX and RMRX schemas then, to deal with the full range of identifiers supported in grammars and native MRSs.</div></div><div class="gmail_msg"><br></div><div class="gmail_msg">all best, oe</div><div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg"><div class="gmail_msg">On Wed 22 Feb 2017 at 19:17 Michael Wayne Goodman <<a href="mailto:goodmami@uw.edu" class="gmail_msg" target="_blank">goodmami@uw.edu</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 class="gmail_msg"><div class="gmail_msg">Thanks, Ann. Francis said (offline) something similar about those being grammar-internal properties. I've updated the RmrsVpm wiki with an example of how to remove them via a VPM (<a href="http://moin.delph-in.net/RmrsVpm#Corner_Cases" class="gmail_msg" target="_blank">http://moin.delph-in.net/RmrsVpm#Corner_Cases</a>). Is there any better place to document this information?</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">And I also thought it might affect MRS's XML format as well, but then I remembered that property names are stored as element text instead of attribute names, so they don't suffer the same problem:</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">...</div><div class="gmail_msg"><extrapair><path>--PSV</path><value>non-apsv</value></extrapair><br class="gmail_msg"></div><div class="gmail_msg">...</div><div class="gmail_msg"><br class="gmail_msg"></div><div class="gmail_msg">It would affect the RMRX format, though.</div></div><div class="gmail_msg"><div class="gmail_extra gmail_msg"><br class="gmail_msg"><div class="gmail_quote gmail_msg">On Feb 22, 2017 04:42, "Ann Copestake" <<a href="mailto:aac10@cl.cam.ac.uk" class="gmail_msg" target="_blank">aac10@cl.cam.ac.uk</a>> wrote:<br type="attribution" class="gmail_msg"><blockquote class="gmail_quote gmail_msg" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div bgcolor="#FFFFFF" class="gmail_msg">
<p class="gmail_msg">from memory, the interpretation of the "--" was intended to be
that this was something that should not appear in the external MRS</p>
<p class="gmail_msg">in any case, it wouldn't be a DMRS issue, as such, since
presumably it could apply to any of the MRS XML formats</p>
<p class="gmail_msg">All best,</p>
<p class="gmail_msg">Ann<br class="gmail_msg">
</p>
<br class="gmail_msg">
<div class="m_8079907655099652921m_-4966240429893746415gmail-m_-6197449233122389341m_-1723262010466248444moz-cite-prefix gmail_msg">On 21/02/17 20:21, Michael Wayne
Goodman wrote:<br class="gmail_msg">
</div>
<blockquote type="cite" class="gmail_msg">
<div class="gmail_msg">
<div class="gmail_msg">Ann:</div>
<div class="gmail_msg"> Does the LKB do anything special regarding properties like
--PSV when reading/writing DMRX? They aren't ill-formed in the
SimpleMRS format, so I'm wondering if PyDelphin should attempt
to do anything special for these.</div>
<div class="gmail_msg"><br class="gmail_msg">
</div>
<div class="gmail_msg">Megha:</div>
<div class="gmail_msg"> I just thought of another alternative. You can serialize
to the DMRS-JSON format instead of DMRX. JSON doesn't have the
same attribute name constraints as XML. The process is
slightly different. Here is MRS->DMRS-JSON conversion:</div>
<div class="gmail_msg"><br class="gmail_msg">
</div>
<div class="gmail_msg"> import json</div>
<div class="gmail_msg"> from delphin.mrs import simplemrs</div>
<div class="gmail_msg"> from delphin.mrs.xmrs import Dmrs</div>
<div class="gmail_msg">
<div class="gmail_msg"> print(</div>
<div class="gmail_msg"> json.dumps(</div>
<div class="gmail_msg">
Dmrs.from_xmrs(simplemrs.load_one(source)).to_dict()</div>
<div class="gmail_msg"> )</div>
<div class="gmail_msg"> )</div>
</div>
<div class="gmail_msg"><br class="gmail_msg">
</div>
<div class="gmail_msg">(the Dmrs.from_xmrs(...) bit is just for Python2
compatibility. In Python3, you can just do:
Dmrs.to_dict(simplemrs.loads_one(source)))</div>
<div class="gmail_msg"><br class="gmail_msg">
</div>
<div class="gmail_msg">DMRS-JSON -> MRS conversion is similar:</div>
<div class="gmail_msg"><br class="gmail_msg">
</div>
<div class="gmail_msg"> ...</div>
<div class="gmail_msg">
<div class="gmail_msg"> print(</div>
<div class="gmail_msg"> simplemrs.dumps_one(</div>
<div class="gmail_msg"> Dmrs.from_dict(json.load(source))</div>
<div class="gmail_msg"> )</div>
<div class="gmail_msg"> ) </div>
</div>
<div class="gmail_msg"><br class="gmail_msg">
</div>
<div class="gmail_msg">These methods require PyDelphin v0.6.0 (the latest
release).</div>
</div>
<div class="gmail_extra gmail_msg"><br class="gmail_msg">
<div class="gmail_quote gmail_msg">On Tue, Feb 21, 2017 at 11:35 AM,
Michael Wayne Goodman <span class="gmail_msg"><<a href="mailto:goodmami@uw.edu" class="gmail_msg" target="_blank">goodmami@uw.edu</a>></span> wrote:<br class="gmail_msg">
<blockquote class="gmail_quote gmail_msg" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div class="gmail_msg">Hi Megha,
<div class="gmail_msg"><br class="gmail_msg">
</div>
<div class="gmail_msg">(I've re-CC'd the developers list so they can benefit
or contribute; please include them in follow-up replies)<br class="gmail_msg">
<div class="gmail_msg"><br class="gmail_msg">
</div>
<div class="gmail_msg">Thanks for clarifying.</div>
</div>
<div class="gmail_msg"><br class="gmail_msg">
</div>
<div class="gmail_msg">When you do MRS -> DMRS conversion in your script,
it is essentially this:</div>
<div class="gmail_msg"><br class="gmail_msg">
</div>
<div class="gmail_msg"> print(dmrx.dumps(simplemrs.load(source)))</div>
<div class="gmail_msg"><br class="gmail_msg">
</div>
<div class="gmail_msg">This loads the simplemrs-encoded source (e.g. a file
or sys.stdin; or use simplemrs.loads() for a string
argument) into the internal *MRS representation, then
the dmrx codec serializes the internal representation to
DMRX. Doing DMRS -> MRS conversion is the same, but
reversed:</div>
<div class="gmail_msg"><br class="gmail_msg">
</div>
<div class="gmail_msg"> print(simplemrs.dumps(dmrx.load(source)))</div>
<div class="gmail_msg"><br class="gmail_msg">
</div>
<div class="gmail_msg">(More technically, the dmrx and simplemrs codecs
decode the text streams/strings and instantiate the
Dmrs() and Mrs() classes, respectively, in the
delphin.mrs.xmrs module. It is these classes (and not
the codecs themselves) that do the actual conversion
into the internal format.)</div>
<div class="gmail_msg"><br class="gmail_msg">
</div>
<div class="gmail_msg">However, there is a problem with the GG grammar and
DMRS. The variable properties prefixed by "--" (e.g.
"--PSV") cause errors when loading a DMRS. This is
because the hyphen is not a valid initial character in
an XML attribute name (<a href="https://www.w3.org/TR/REC-xml/#NT-NameStartChar" class="gmail_msg" target="_blank">https://www.w3.org/TR/REC-xml/#NT-NameStartChar</a>).
It is Python's XML parser, and not PyDelphin, that is
failing to load the DMRX instance. I suggest doing one
of the following:</div>
<div class="gmail_msg"><br class="gmail_msg">
</div>
<div class="gmail_msg"> 1. Change the attribute names in the GG grammar</div>
<div class="gmail_msg"><br class="gmail_msg">
</div>
<div class="gmail_msg"> 2. In your conversion script, find and replace these
attributes on the MRS before converting to DMRS, and
change them back in DMRS->MRS conversion. You may use
underscores (e.g. "__PSV") as the initial character,
according to the XML spec.</div>
<div class="gmail_msg"><br class="gmail_msg">
</div>
<div class="gmail_msg">Does this help?</div>
</div>
<div class="gmail_extra gmail_msg">
<div class="gmail_msg">
<div class="m_8079907655099652921m_-4966240429893746415gmail-m_-6197449233122389341m_-1723262010466248444h5 gmail_msg"><br class="gmail_msg">
<div class="gmail_quote gmail_msg">On Tue, Feb 21, 2017 at 1:13
AM, megha jain <span class="gmail_msg"><<a href="mailto:jain11megha@gmail.com" class="gmail_msg" target="_blank">jain11megha@gmail.com</a>></span>
wrote:<br class="gmail_msg">
<blockquote class="gmail_quote gmail_msg" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div 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">
<div class="gmail_msg">
<div class="gmail_msg">Hello Michael.<br class="gmail_msg">
<br class="gmail_msg">
</div>
I know usage of Pydelphin so able
to implement via this.<br class="gmail_msg">
<br class="gmail_msg">
</div>
I want to know which python code is
being used by you to convert German
DMRS into German MRS again?<br class="gmail_msg">
<br class="gmail_msg">
</div>
So that this MRS can be given ACE to
generate corresponding German
sentence.<br class="gmail_msg">
<br class="gmail_msg">
</div>
I am able to process : German sentence
=> MRS<br class="gmail_msg">
</div>
MRS
=> DMRS<br class="gmail_msg">
</div>
DMRS
=> MRS (that is my concern)<br class="gmail_msg">
<br class="gmail_msg">
</div>
<div class="gmail_msg">EXAMPLE :-(A.) INPUT : Abrams bellte
sehr leise.</div>
<div class="gmail_msg"><br class="gmail_msg">
(B.) When I gave above one sentence to ACE ,
It generated following MRS :-<br class="gmail_msg">
(command used : ./ace -g ggp.dat -1Tf
input_file.txt)<br class="gmail_msg">
<br class="gmail_msg">
</div>
<div class="gmail_msg">Following file is attached below.<br class="gmail_msg">
</div>
<div class="gmail_msg"><br class="gmail_msg">
</div>
<div class="gmail_msg">(C) I gave this MRS as an input to
mrs_to_dmrs-pp.py pyhon code and
corresponding DMRS generated.<br class="gmail_msg">
</div>
<div class="gmail_msg">Following file is attached below.<br class="gmail_msg">
<br class="gmail_msg">
</div>
<div class="gmail_msg">(D.) After this I want to convert
corresponding DMRS into MRS . Which python
code comes in use for this approach?<br class="gmail_msg">
</div>
<div class="gmail_msg"><br class="gmail_msg">
<br class="gmail_msg">
</div>
Hopefully I am able to make you understand
what is my concern.<br class="gmail_msg">
<br class="gmail_msg">
</div>
Thank You.<br 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">
<div class="gmail_msg"><br class="gmail_msg">
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br class="gmail_msg">
<br clear="all" class="gmail_msg">
<div class="gmail_msg"><br class="gmail_msg">
</div>
</div>
</div>
<span class="m_8079907655099652921m_-4966240429893746415gmail-m_-6197449233122389341m_-1723262010466248444HOEnZb gmail_msg"><font color="#888888" class="gmail_msg">-- <br class="gmail_msg">
<div class="m_8079907655099652921m_-4966240429893746415gmail-m_-6197449233122389341m_-1723262010466248444m_-4721760205035595285gmail_signature gmail_msg">
<div class="gmail_msg">Michael Wayne Goodman
<div class="gmail_msg">Ph.D. Candidate, UW Linguistics</div>
</div>
</div>
</font></span></div>
</blockquote>
</div>
<br class="gmail_msg">
<br clear="all" class="gmail_msg">
<div class="gmail_msg"><br class="gmail_msg">
</div>
-- <br class="gmail_msg">
<div class="m_8079907655099652921m_-4966240429893746415gmail-m_-6197449233122389341m_-1723262010466248444gmail_signature gmail_msg">
<div class="gmail_msg">Michael Wayne Goodman
<div class="gmail_msg">Ph.D. Candidate, UW Linguistics</div>
</div>
</div>
</div>
</blockquote>
<br class="gmail_msg">
</div>
</blockquote></div></div>
</div></blockquote></div></div></div>