Remove short_thread

This commit is contained in:
karoel2 2022-06-15 08:48:04 +02:00
parent ac0a3417da
commit 57c1893a55

View File

@ -37,16 +37,16 @@ gramar_slots = {
def taktyka_dialogu(state, frame):
if frame['act'] == 'null':
return 'null'
if state['current_context'] in ['hello', 'pomoc', 'bye']:
return short_thread(state)
else:
return long_thread(state)
# if state['current_context'] in ['hello', 'pomoc', 'bye']:
# return short_thread(state)
# else:
return long_thread(state)
def short_thread(state):
if state['current_context'] == 'pomoc':
return state['current_context']
else:
return state['current_context']
# def short_thread(state):
# if state['current_context'] == 'pomoc':
# return state['current_context']
# else:
# return state['current_context']
def validate_repo(repo):
if repo not in listRepositories():
@ -61,13 +61,13 @@ def long_thread(state):
slots = topic['slots']
required = gramar_slots[act]
req_args, opt_args = agregate(required, slots)
facts = state['facts']# osobno validuj repo z req i z facts
facts = state['facts']
req_args = add_facts(req_args, facts)
opt_args = add_facts(opt_args, facts)
required_empty = check_req(req_args)
if required_empty:
return "QESTION", required_empty[0] #slot do uzupełnienia
return "ANSWER", act, req_args, opt_args #wyświetl użytkownikowi
return False, required_empty[0] #slot do uzupełnienia
return True, act, req_args, opt_args #wyświetl użytkownikowi
def check_req(req_args):
req = []
@ -99,4 +99,3 @@ def agregate(grammar, slots):
elif item[1] == 'optional':
opt_args.append([item[0], value])
return req_args, opt_args