1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
#!/usr/bin/env python3
# Copyright (c) 2010 Carnegie Mellon University
#
# You may copy and modify this freely under the same terms as
# Sphinx-III
"""
FST utility functions
"""
__author__ = "David Huggins-Daines <dhdaines@gmail.com>"
__version__ = "$Revision $"
import sphinxbase
from . import fstutils
import openfst
import sys
if __name__ == '__main__':
lmfile, probdef = sys.argv[1:]
lm = sphinxbase.NGramModel(lmfile)
lmfst = fstutils.build_class_lmfst(lm, probdef, True)
openfst.StdVectorFst(lmfst).Write(lmfile + ".fst")
|