discodop.demos

Examples of various formalisms encoded in LCFRS grammars.

Functions

bitext() Bitext parsing with a synchronous CFG.
dependencygrammar() An example dependency structure encoded in an LCFRS grammar.
main() Run all examples.
parse(compiledgrammar, testsent[, testtags]) Parse a sentence with a grammar.
test() Alias for main().
tree_adjoining_grammar() Example of a tree-adjoining grammar (TAG) encoded as an LCFRS.
discodop.demos.tree_adjoining_grammar()[source]

Example of a tree-adjoining grammar (TAG) encoded as an LCFRS.

Taken from: Chen & Vijay-Shanker (IWPT 2000), Automated extraction of TAGs from the Penn treebank. http://nlp.cs.nyu.edu/nycnlp/autoextract.ps

  • no epsilon productions
  • non-terminals have identifiers to encode elementary trees of depth > 2.
discodop.demos.dependencygrammar()[source]

An example dependency structure encoded in an LCFRS grammar.

Taken from: Gildea (2010, fig. 4), Optimal Parsing Strategies for Linear Context-Free Rewriting Systems. http://aclweb.org/anthology/N10-1118

  • rules have to be binarized
  • lexical rules have to be unary

These have been dealt with by introducing nodes w/underscores.

discodop.demos.bitext()[source]

Bitext parsing with a synchronous CFG.

Translation would require a special decoder (instead of normal k-best derivations where the whole sentence is given).