Frames in taktyka_dialogu

This commit is contained in:
emkarcinos 2022-04-20 10:55:53 +02:00
parent 012dd6e2a3
commit c584b99d95
2 changed files with 6 additions and 6 deletions

View File

@ -10,7 +10,7 @@ def main():
text = input('>>>') text = input('>>>')
frame = analizator_jezyka_naturalnego(text) frame = analizator_jezyka_naturalnego(text)
state = monitor_stanu_dialogowego(frame) state = monitor_stanu_dialogowego(frame)
response_frames = taktyka_dialogu(state) response_frames = taktyka_dialogu(state, frame)
generator_jezyka_nautalnego(response_frames) generator_jezyka_nautalnego(response_frames)
if __name__ == '__main__': if __name__ == '__main__':

View File

@ -10,18 +10,18 @@ def check_condition(state, conditions, type=all):
return False return False
def taktyka_dialogu(state): def taktyka_dialogu(state, frame):
if should_respond_gently(state): if should_respond_gently(frame):
return [hello_act, name_response_act] return [hello_act, name_response_act]
if should_prompt(state): if should_prompt(frame):
return [hello_act, help_response_act] return [hello_act, help_response_act]
if should_respond_cold(state): if should_respond_cold(frame):
return [name_response_act] return [name_response_act]
return [unknown_act] return [unknown_act]
def should_respond_gently(state): def should_respond_gently(state):
return check_condition(state, [hello_act, name_request_act]) return check_condition(state, [hello_act, name_request_act])
def should_prompt(state): def should_prompt(state):