Finite-state grammar compilation
copied from cf-staging / pyniniPynini compiles grammars expressed as strings, regular expressions, and context-dependent rewrite rules into weighted finite-state transducers. It uses the OpenFst library and its Python extension to create, access and manipulate compiled grammars.