From ede9b13a0b8c32483545d36433c35dcd92dd7c60 Mon Sep 17 00:00:00 2001 From: s444417 Date: Sun, 13 Mar 2022 11:08:52 +0100 Subject: [PATCH] add condition --- .idea/.gitignore | 3 ++ .idea/Systemy dialogowe.iml | 8 +++++ .idea/inspectionProfiles/Project_Default.xml | 31 +++++++++++++++++++ .../inspectionProfiles/profiles_settings.xml | 6 ++++ .idea/misc.xml | 4 +++ .idea/modules.xml | 8 +++++ .idea/vcs.xml | 6 ++++ cheddar.py | 16 ++++++++-- eliza.py | 2 ++ 9 files changed, 82 insertions(+), 2 deletions(-) create mode 100644 .idea/.gitignore create mode 100644 .idea/Systemy dialogowe.iml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 eliza.py diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/Systemy dialogowe.iml b/.idea/Systemy dialogowe.iml new file mode 100644 index 0000000..d0876a7 --- /dev/null +++ b/.idea/Systemy dialogowe.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..ae5a833 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,31 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..d1e22ec --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..c30d6aa --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..94a25f7 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/cheddar.py b/cheddar.py index 7e970ca..a4b332c 100644 --- a/cheddar.py +++ b/cheddar.py @@ -7,7 +7,6 @@ reflections = { "bylem": "byles", "bylam": "bylas", "ja": "ty", - "jestem": "jestes", "chcialbym": "chcialbys", "chcialabym": "chcialabys", "mam": "masz", @@ -21,7 +20,6 @@ reflections = { "masz": "mam", "bedziesz": "bede", "twoj": "moj", - "twoja": "moja", "twoim": "moim", "twojego": "mojego", "ty": "ja", @@ -100,6 +98,20 @@ pairs = ( "Jesli %1, to co jeszcze musi byc prawda?", ), ), + ( + r"quit", ( + "Do uslyszenia", + "Czesc" + ), + ), + ( + r"(.*)", + ( + "Zmienmy na chwile temat, powiedz mi o swojej rodzinie", + "%1?", + "Dlaczego tak mowisz?", + ), + ), ) cheddar = Chat(pairs, reflections) diff --git a/eliza.py b/eliza.py new file mode 100644 index 0000000..b032d50 --- /dev/null +++ b/eliza.py @@ -0,0 +1,2 @@ +from nltk.chat import eliza +eliza.demo() \ No newline at end of file