We present Pynini, an open-source library allowing users to compile weighted
finite-state transducers (FSTs) and pushdown transducers from strings,
context-dependent rewrite rules, and recursive transition networks. Pynini uses the
OpenFst library for encoding, modifying, and applying WFSTs, as well as a powerful
generic optimization routine. We describe the design of this library and the
algorithms and interfaces used for FST and PDT compilation and optimization, and
illustrate its use for a natural language processing application.