Menu

Difference between ccg format grammar and xml format grammar

Help
Zhao Meng
2016-08-05
2016-08-08
  • Zhao Meng

    Zhao Meng - 2016-08-05

    Hi,

    Sorry to bother.

    It seems that the grammars in the grammars directory are very different from ccg format grammars not only in their formats. The grammars in the grammars directory seems to need additional xsl file for transformation when realizing because it just fails to realize when I tried ccg-realize with these grammars. I've seen those xsl but I'm not sure what they do.

    I find these in the grammar.xml of routes:

      <LF-from-XML>
        <transform file="../treeify-lists.xsl"/>
        <transform file="../convert-to-hlds.xsl"/>
        <transform file="../core-en/add-chunks.xsl"/>
      </LF-from-XML>
    
      <LF-to-XML>
        <transform file="../core-en/raise-nodes.xsl"/>
        <transform file="../convert-to-graph.xsl"/>
        <transform file="../simplify-lists.xsl"/>
      </LF-to-XML>
    

    Thanks.

     
  • Michael White

    Michael White - 2016-08-06

    Right, with each grammar you can configure a sequence of XSLT transformations to use when converting to/from XML and the internal HLDS representation.

    The convert-to-graph and convert-to-hlds transformations convert between an XML representation of HLDS and a more intuitive representation of a graph in terms of 'node' and 'rel' elements. The use of this pair is usual practice for realization.

    The raise-nodes transformation factors our shared nodes in coordination. Schematically, rather than "(John_x walks) and (x talks)" for "John walks and talks", the shared argument here is factored out to become "(John_x) ((x walks) and (x talks))". The use of this transformation is typical but is sensitive to the exact representation of coordinate structures in terms of which nodes and rels are used.

    The add-chunks transformation adds realization chunking constraints for all subtrees in the LF (default). This works hand in hand with raise-nodes, so that there's a chunk for the VP "walks and talks" separate from the subject. (Similarly for right-node-raising, etc.) The use of this transformation is usual practice.

    The treeify-lists and simplify-lists transformations are just a convenience to allow a list to be a simple sequence of elements in XML rather than a chain of dependencies. It has not been used beyond the routes grammar example, but it could be.

     
    • Zhao Meng

      Zhao Meng - 2016-08-08

      Many thanks!

       

Log in to post a comment.