-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtalk.py
More file actions
75 lines (72 loc) · 2.5 KB
/
talk.py
File metadata and controls
75 lines (72 loc) · 2.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
class speach:
initial_spich="Hi, I'm Chatty and I chat alot ;)\nPlease type lowercase English language to start a conversation. Type quit to leave " # default message at the start
class pairs:
def get_pairs():
pairs = [
[
# in line below You can find question to bot, on next line is answer
r"nazywam się (.*)",
["Cześć %1, podasz mi swój login ?", ]
],
[
r"jak się nazywasz?|jak sie nazywasz?",
["Nazywam się Chatty i jestem chatbotem, ale będę Terminatorem", ]
],
[
r"jak się masz?",
["Wszytko dobrze\nA jak u Ciebie ?", ]
],
[
r"przepraszam (.*)",
["W porządku", "OK, nie ważne", ]
],
[
r"(.*) dobrze",
["Miło to słyszeć", "Super :)", ]
],
[
r"cześć|dzień dobry|siema",
["Cześć", "Dzień dobry", "Uszanowanko"]
],
[
r"(.*) wiek?| (.*) lat?",
["Jestem programem komputerowym koleś\nPoważnie o to mnie pytasz?", ]
],
[
r"chcesz (.*) ?",
["Złożyłeś mi ofertę, nie mogę odmówić", ]
],
[
r"(.*) stworzył?",
["Programista używający Python z biblioteką NLTK library ", "top secret ;)", ]
],
[
r"(.*) (lokalizacja|miasto|gdzie mieszkasz)?",
['Gdańsk, Polska', ]
],
[
r"jaka jest pogoda w (.*)?",
["Pogoda w %1 jest super jak zawsze", "Jest za gorąco dla mnie w %1", "Jest za zimno dla mnie w %1",]
],
[
r"pracuje w (.*)?",
["%1 jest wspaniałą firmą, słyszałem o tym.", ]
],
[
r"(.*) (sport|gra) ?",
["jestem wielkim fanem footballu", ]
],
[
r"kto (.*) sportowcem ?",
["Messy", "Ronaldo", "Roony"]
],
[
r"kto (.*) (gwiazdą filmową|aktorem)?",
["Brad Pitt"]
],
[
r"quit",
["BBye take care. See you soon :) ", "It was nice talking to you. See you soon :)"]
],
]
return pairs