From 7d0497c336f7475ab62be9706a098f0cb6b44e40 Mon Sep 17 00:00:00 2001 From: Maciej Sobkowiak Date: Sat, 20 Mar 2021 16:54:12 +0100 Subject: [PATCH] Added basic logic --- .gitignore | 1 + chatbot.py | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) create mode 100644 .gitignore create mode 100644 chatbot.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..a979ee7 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/venv \ No newline at end of file diff --git a/chatbot.py b/chatbot.py new file mode 100644 index 0000000..855fa3f --- /dev/null +++ b/chatbot.py @@ -0,0 +1,17 @@ +from nltk.chat.util import Chat, reflections + +pairs = [ + [ + r"(.*)nazywam się (.*)", + ["Cześć %2, jak się dzisiaj czujesz?",] + ] +] + +chatbot = Chat(pairs, reflections) + +def hello(): + print("Przedstaw się\n") + chatbot.converse() + +if __name__ == "__main__": + hello() \ No newline at end of file