diff --git a/system_mockup/generator_jezyka_nautalnego.py b/system_mockup/generator_jezyka_nautalnego.py index f3ff2a2..4f13a79 100644 --- a/system_mockup/generator_jezyka_nautalnego.py +++ b/system_mockup/generator_jezyka_nautalnego.py @@ -1,2 +1,2 @@ -def generator_jezyka_nautalnego(): - pass +def generator_jezyka_nautalnego(frames): + print(frames) diff --git a/system_mockup/system_dialogowy.py b/system_mockup/system_dialogowy.py index 9d67e4e..e09e55b 100644 --- a/system_mockup/system_dialogowy.py +++ b/system_mockup/system_dialogowy.py @@ -10,8 +10,8 @@ def main(): text = input('>>>') frame = analizator_jezyka_naturalnego(text) state = monitor_stanu_dialogowego(frame) - taktyka_dialogu(state) - generator_jezyka_nautalnego() + response_frames = taktyka_dialogu(state) + generator_jezyka_nautalnego(response_frames) if __name__ == '__main__': main() diff --git a/system_mockup/taktyka_dialogu.py b/system_mockup/taktyka_dialogu.py index d431d53..37f373c 100644 --- a/system_mockup/taktyka_dialogu.py +++ b/system_mockup/taktyka_dialogu.py @@ -1,2 +1,37 @@ +from os import stat +from re import S +from acts import * + + +welcome = 'Witaj!' +prompt = 'Zapytaj mnie o moje imię.' +resp = 'Nazywam się Dia.' + + +def check_condition(state, conditions, type=all): + if type(i in state for i in conditions): + return True + + return False + + def taktyka_dialogu(state): - print(state) + if should_respond_gently(state): + return [hello_act, name_response_act] + if should_prompt(state): + return [help_response_act] + if should_respond_cold(state): + return [name_response_act] + return [unknown_act] + + +def should_respond_gently(state): + return check_condition(state, [hello_act, name_request_act]) + + +def should_prompt(state): + return check_condition(state, [hello_act], any) + + +def should_respond_cold(state): + return check_condition(state, [name_request_act]) \ No newline at end of file