[Attempto] Can't unparse expressions (from DRSXML) using atom_to_term/3, Single quotes lost

Tobias Kuhn t.kuhn at gmx.ch
Tue Jun 2 17:38:28 CEST 2009


Hi Joshua,

I agree. Strings should be quoted in the XML representation of the DRS. It's no my todo list now and 
I will fix it as soon as possible.

By the way, new versions of the files parser/grammar.fit and utils/drs_to_xml.pl are attached that 
should solve the problem with the XML output for sentences like "John likes Mary". (However, it's 
not yet systematically tested.)


Tobias


Joshua TAYLOR wrote:
> Hello,
> 
> I'm having a bit of trouble unparsing expressions using
> atom_to_term/3.  It seems that single quotes that are present in
> Prolog output are lost in DRSXML output. For instance:
> 
> === DRS output
> 
> CL-USER 28 > (invoke-ape-webservice :text "\"a)b\" is good." :solo "drs")
> "drs([A, B], [property(A, good, pos)-1/5, predicate(B, be,
> string('a)b'), A)-1/4])"
> 
> ?- atom_to_term("string('a)b')",X,Y).
> X = string('a)b'),
> Y = [].
> 
> === DRSXML output
> 
> <DRS domain=\"A B\">
>   <property ref=\"A\" adj=\"good\" degree=\"pos\" sentid=\"1\" tokid=\"5\"/>
>   <predicate ref=\"B\" verb=\"be\" subj=\"string(a)b)\"
>       obj=\"A\" sentid=\"1\" tokid=\"4\"/>
> </DRS>"
> 
> ?- atom_to_term("string(a)b)",X,Y).
> ERROR: Syntax error: Operator expected
> ERROR: string(a)
> ERROR: ** here **
> ERROR: b) .
> 
> Now, I couldn't find anything that explicitly affirmed that the DRSXML
> attribute values would be string representations of Prolog atoms, but
> the representations seemed close enough that it was probably the case.
>  If string contents aren't quoted, the expressions can easily become
> ambiguous.  E.g., (a contrived example):
> 
> CL-USER 33 > (invoke-ape-webservice :text "John dictates \"Every )
> must be preceded by a (.\"." :solo "drsxml")
> "<?xml version=\"1.0\" encoding=\"UTF-8\"?>
> 
> <DRS domain=\"A\">
>   <predicate
>       ref=\"A\"
>       verb=\"dictate\"
>       subj=\"named(John)\"
>       obj=\"string(Every ) must be preceded by a (.)\"
>       sentid=\"1\"
>       tokid=\"2\"/>
> </DRS>"
> 
> Regards,
> Joshua
> _______________________________________________
> attempto mailing list
> attempto at lists.ifi.uzh.ch
> https://lists.ifi.uzh.ch/listinfo/attempto
> 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: grammar.fit
Type: image/x-fits
Size: 193937 bytes
Desc: not available
URL: <http://lists.ifi.uzh.ch/pipermail/attempto/attachments/20090602/a28dbb58/attachment-0001.bin>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: drs_to_xml.pl
URL: <http://lists.ifi.uzh.ch/pipermail/attempto/attachments/20090602/a28dbb58/attachment.asc>


More information about the attempto mailing list