Move acts to consts
This commit is contained in:
parent
6bc9f36154
commit
b8192b498a
5
system_mockup/acts.py
Normal file
5
system_mockup/acts.py
Normal file
@ -0,0 +1,5 @@
|
||||
hello_act = 'hello'
|
||||
name_request_act = 'request(name)'
|
||||
name_response_act = 'inform(name)'
|
||||
help_response_act = 'helpresponse'
|
||||
unknown_act = 'null'
|
@ -1,11 +1,13 @@
|
||||
import re
|
||||
|
||||
from acts import hello_act, name_request_act
|
||||
|
||||
hello = ['dzie[ńn] dobry', 'dobry wiecz[oó]r', 'witam', 'witaj', 'siema', 'elo', 'cze[śs][ćc]']
|
||||
request_name = ['imi[eę]', 'nazywasz']
|
||||
question = ['\?$']
|
||||
|
||||
acts = {'hello': [hello],
|
||||
'request(name)': [request_name, question]}
|
||||
acts = {hello_act: [hello],
|
||||
name_request_act: [request_name, question]}
|
||||
|
||||
def analizator_jezyka_naturalnego(text):
|
||||
text = text_preprocess(text)
|
||||
|
@ -1,3 +1,6 @@
|
||||
from acts import hello_act
|
||||
|
||||
|
||||
dialogue_state = []
|
||||
|
||||
def monitor_stanu_dialogowego(frame):
|
||||
@ -9,6 +12,6 @@ def monitor_stanu_dialogowego(frame):
|
||||
|
||||
|
||||
def reset_state_if_needed(frame):
|
||||
if 'hello' in frame:
|
||||
if hello_act in frame:
|
||||
dialogue_state.clear()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user