We will use our metagrammars with the Loria LTAG Parser 2 (LLP2). Please do the following:
$ cp -r /afs/sfs/lehre/wmaier/tag-seminar/parsing ~/ $ cd ~/parsingThe parsing directory contains
small-english3.mg | a metagrammar |
lex | lexicon file containing base forms and their links to tree families of the metagrammar |
morph | another lexicon file, containing inflected forms and features contributed by the lexical items |
compilegram.sh | a script to compile these three files into a single grammar |
xmg-tag.dtd,xml | a link to the Document Type Definiton (DTD) of the TAGML2 XML format, needed during the compilation process |
$ ~/parsing/compilegram.sh small-english3.mg lex morph > grammar.xmlThe compiled grammar contains the anchored LTAG. To invoke the parser, type
$ llp2-guiand load the compiled grammar. Alternatively, you can use the parser on the command line by typing
$ llp2-parser [-feature] -tagml2 grammar.xml
(1) John sleeps (2) John always sleepsNow try the parser on the sentences (3)-(12). To get them parsed, you might have to add lexical material to the files lex and morph and/or tree classes to the metagrammar.
(3) who sleeps (4) every boy sleeps (5) Mary loves John (6) who loves Mary (7) Mary thinks John sleeps (8) who thinks John sleeps (9) whom does Mary love (10) John gives a book to Mary (11) John gives Mary a book (12) what does John give to Mary