0
我使用的WSR,它可以分析一個字做一個程序,龍蠅,任何聲音匹配這個詞,輸出「是它匹配」蟒蛇蜻蜓認識到類似的話
如果我說「捷克斯洛伐克」那麼它必須打印真實的,即使對於這個世界的所有類似的比賽,就像'斯洛伐克圈,貓在slavia,seko vakia ...'
什麼具體的方法,我應該用這個?
我的程序
from dragonfly.all import *
import pythoncom
import time
# Voice command rule combining spoken form and recognition processing.
class ExampleRule(CompoundRule):
spec = "czechoslovakia|circle slovalia|sceko bakia|cat on ania" # Spoken form of command.
def _process_recognition(self, node, extras): # Callback when command is spoken.
print "Voice command spoken."
# Create a grammar which contains and loads the command rule.
grammar = Grammar("example grammar") # Create a grammar to contain the command rule.
grammar.add_rule(ExampleRule()) # Add the command rule to the grammar.
grammar.load() # Load the grammar.
while True:
pythoncom.PumpWaitingMessages()
time.sleep(.1)
那麼你如何定義「相似」呢。你可能想詳細說明一下。 – 2014-11-02 15:28:40