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
|
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]']
|
hello = ['dzie[ńn] dobry', 'dobry wiecz[oó]r', 'witam', 'witaj', 'siema', 'elo', 'cze[śs][ćc]']
|
||||||
request_name = ['imi[eę]', 'nazywasz']
|
request_name = ['imi[eę]', 'nazywasz']
|
||||||
question = ['\?$']
|
question = ['\?$']
|
||||||
|
|
||||||
acts = {'hello': [hello],
|
acts = {hello_act: [hello],
|
||||||
'request(name)': [request_name, question]}
|
name_request_act: [request_name, question]}
|
||||||
|
|
||||||
def analizator_jezyka_naturalnego(text):
|
def analizator_jezyka_naturalnego(text):
|
||||||
text = text_preprocess(text)
|
text = text_preprocess(text)
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
|
from acts import hello_act
|
||||||
|
|
||||||
|
|
||||||
dialogue_state = []
|
dialogue_state = []
|
||||||
|
|
||||||
def monitor_stanu_dialogowego(frame):
|
def monitor_stanu_dialogowego(frame):
|
||||||
@ -9,6 +12,6 @@ def monitor_stanu_dialogowego(frame):
|
|||||||
|
|
||||||
|
|
||||||
def reset_state_if_needed(frame):
|
def reset_state_if_needed(frame):
|
||||||
if 'hello' in frame:
|
if hello_act in frame:
|
||||||
dialogue_state.clear()
|
dialogue_state.clear()
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user