Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 9c92132392

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.

pycdec is a Python interface to cdec


Build and install pycdec:

python install

Grammar extractor

Compile a parallel corpus and a word alignment into a suffix array representation:

python -m -f f.txt -e e.txt -a a.txt -o output/ -c extract.ini

Extract grammar rules from the compiled corpus:

cat input.txt | python -m -c extract.ini -g grammars/

This will create per-sentence grammar files in the grammars directory and output annotated input suitable for translation with cdec.

Library usage

A basic demo of pycdec's features is available in

More documentation will come as the API becomes stable.

pycdec was contributed by Victor Chahuneau

Something went wrong with that request. Please try again.