else: i = i + 1 return 0 def getWord(inp): return inp[1]["WORD"] def stop(inp): print "This test script is defined until here. Terminated." sys.exit() # construct and add transition rules greet = FSM.State() regreet = FSM.State() endChoose = FSM.State() pathChoose = FSM.State() pathPMG = FSM.State() pathPlPET = FSM.State() pathM = FSM.State() pathPa = FSM.State() pathPP = FSM.State() pathPl = FSM.State() pathGl = FSM.State() askMore = FSM.State() end = FSM.State() #set FST transitions
def getClassID(inp): return inp[1]["CLASSID"] # プログラムを終了する def end_sys(proxy): global options proxy.end() julius_process.kill() if os.path.exists('talking.wav'): os.remove('talking.wav') exit() # 状態を生成 s_greet = FSM.State() s_location = FSM.State() s_other_data = FSM.State() s_exit = FSM.State() s_help = FSM.State() # 遷移関数を定義 loc = [0, 1, 2, 3, 4, 5, 6] date = [7] detail = [10] bye = [13] help = [14] s_greet.setTransition(getClassID, loc, s_location, wg.today_report) s_greet.setTransition(getClassID, bye, s_exit, wg.goodbye) s_greet.setTransition(getClassID, help, s_help, wg.help)