rhubarb-lip-sync/rhubarb/lib/pocketsphinx-rev13216/swig/python/test/fsg_test.py

16 lines
292 B
Python
Raw Normal View History

2015-10-19 19:45:08 +00:00
#!/usr/bin/python
import sys
from sphinxbase.sphinxbase import LogMath
from sphinxbase.sphinxbase import FsgModel
lmath = LogMath()
fsg = FsgModel("simple_grammar", lmath, 1.0, 10)
fsg.word_add("hello")
fsg.word_add("world")
print (fsg.word_id("world"))
fsg.add_silence("<sil>", 1, 0.5)