mirror of
https://github.com/cmusphinx/sphinxtrain.git
synced 2026-06-16 13:14:30 +00:00
25 lines
549 B
Python
25 lines
549 B
Python
#!/usr/bin/env python
|
|
|
|
# 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")
|