diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ba0430d --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +__pycache__/ \ No newline at end of file diff --git a/system_mockup/monitor_stanu_dialogowego.py b/system_mockup/monitor_stanu_dialogowego.py index 00661b1..3ffee6a 100644 --- a/system_mockup/monitor_stanu_dialogowego.py +++ b/system_mockup/monitor_stanu_dialogowego.py @@ -1,2 +1,14 @@ +dialogue_state = [] + def monitor_stanu_dialogowego(frame): - print(frame) + # Some frames can reset the dialogue state, like saying hello. + reset_state_if_needed(frame) + + list(map(lambda x: dialogue_state.append(x), frame)) + return dialogue_state + + +def reset_state_if_needed(frame): + if 'hello' in frame: + dialogue_state.clear() + diff --git a/system_mockup/system_dialogowy.py b/system_mockup/system_dialogowy.py index 07558e1..9d67e4e 100644 --- a/system_mockup/system_dialogowy.py +++ b/system_mockup/system_dialogowy.py @@ -4,11 +4,14 @@ from taktyka_dialogu import taktyka_dialogu from generator_jezyka_nautalnego import generator_jezyka_nautalnego def main(): - text = input('>>>') - frame = analizator_jezyka_naturalnego(text) - monitor_stanu_dialogowego(frame) - taktyka_dialogu() - generator_jezyka_nautalnego() + running = True + + while running: + text = input('>>>') + frame = analizator_jezyka_naturalnego(text) + state = monitor_stanu_dialogowego(frame) + taktyka_dialogu(state) + generator_jezyka_nautalnego() if __name__ == '__main__': main() diff --git a/system_mockup/taktyka_dialogu.py b/system_mockup/taktyka_dialogu.py index 19565cf..d431d53 100644 --- a/system_mockup/taktyka_dialogu.py +++ b/system_mockup/taktyka_dialogu.py @@ -1,2 +1,2 @@ -def taktyka_dialogu(): - pass +def taktyka_dialogu(state): + print(state)