[developers] Valid MRS? Bug in ERG?

goodman.m.w at gmail.com goodman.m.w at gmail.com
Fri Sep 25 03:34:44 CEST 2020


On Fri, Sep 25, 2020 at 7:07 AM Alexandre Rademaker <arademaker at gmail.com>
wrote:

>
> Hi Michael and Stephan,
>
> A good place to learn about the Lisp format is
> http://www.gigamonkeys.com/book/a-few-format-recipes.html
>
> [...]


Thanks Alexandre for the links and the explanation.

I tried reading some elisp docs and a guide on format in order to
understand the expression when Stephan posted it, but after about 20
minutes I decided that was too much effort just to understand an email, so
I gave up.

It looks like the serialisation/encode of EDS in pydelphin is also robust
> to empty top:
>
>
> https://github.com/delph-in/pydelphin/blob/develop/delphin/codecs/eds.py#L257
>

Hmm, I guess I anticipated that because I allow an empty top in the data
structure. Thanks for digging that up!



> But the decode/parse is not, see tests below. Actually, encode should not
> emit a colon in the first line and, of course, there is this discussion
> about the line-oriented format that would require a broad review of the
> encode/decode of EDS.
>

I think the colon was deliberate to avoid potential ambiguity with the
identifier of the first node. Stephan instead wants to make newlines
obligatory. I'm happy to make newlines + indentation the default for EDS
native serialization, but I'm not prepared to get rid of the ability to
write single-line EDS.


>
> I have submitted a PR to Michael solving the translation from MRS to EDS,
> but I didn’t touch in the decode/encode functions.
>

Thanks, I'll take a look.

I found the Lisp code in the lkb/src/mrs/dependencies.lisp file, so it is
> part of the LKB source code. I am curious, what `psoa` stands for?
>
> "probable-state-of-affairs". But I'm not sure where that terminology comes
from.



>
> [...]
> >>> edsnative.decode(x)
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
>   File "/Users/ar/venv/lib/python3.8/site-packages/delphin/codecs/eds.py",
> line 110, in decode
>     lexer = _EDSLexer.lex(s.splitlines())
> AttributeError: 'EDS' object has no attribute 'splitlines'
>

Here you have attempted to decode x, which is the EDS data structure.
Instead you'd want to do `edsnative.decode(edsnative.encode(x))`, but that
also fails because it expects the top variable before the colon. It appears
my robustness attempt was incomplete.

-- 
-Michael Wayne Goodman
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.delph-in.net/archives/developers/attachments/20200925/755cad5e/attachment.html>


More information about the developers mailing list