-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDora.py
More file actions
124 lines (93 loc) · 3.01 KB
/
Dora.py
File metadata and controls
124 lines (93 loc) · 3.01 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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
from wit import Wit
from replies import *
Traits = 'traits'
Entities = 'entities'
Greeting = 'greetings'
Access_Token = 'EM4HWKVERLHRFOQGPSCGBM27BZYN3RO2'
Behaviour = 'behaviour'
Gender = 'gender'
Intent = 'intent'
Weight = 'weight'
Sports = 'sports'
Places = 'places'
Person = 'person'
Show = 'shows'
Music = 'music'
LoveLife = 'LoveLife'
Virgin = 'verginity'
Movie = 'movie'
Relationship = 'relationship'
Food = 'eat'
Weed = 'weed'
Country = 'country'
Skill = 'skills'
Height = 'height'
Favorite = 'favorite'
Value = 'value'
Hobby = 'hobby'
Location = 'location'
Age = 'age'
def get_reply(qns):
final_reply = ""
dora = Wit(Access_Token)
dict = dora.message(qns)
entity_list = dict[Entities]
print(entity_list)
# TESTING
# entity_list = qns
# Check for greetings
Lonely = 'lonely' in entity_list
Feelings = 'feelings' in entity_list
Happy = 'happy' in entity_list
if Greeting in entity_list:
final_reply += get_greetings(entity_list)
# if Age in dict:
if Age in entity_list:
# final_reply += " "
final_reply += get_age(entity_list)
# Roles go in here.
if Gender in entity_list:
final_reply += get_gender(entity_list, qns)
if Weight in entity_list:
final_reply += get_weight(entity_list)
if Height in entity_list:
final_reply += get_height(entity_list)
if Location in entity_list:
final_reply += get_location(entity_list)
if Lonely or Happy or Feelings:
final_reply += get_feelings(entity_list, qns)
if Country in entity_list:
final_reply += get_country(entity_list, qns)
if Hobby in entity_list:
final_reply += get_hobby(entity_list)
if Skill in entity_list:
final_reply += get_skills(qns)
if Music in entity_list:
final_reply += get_favorite(entity_list, qns)
if Food in entity_list:
final_reply += get_favorite(entity_list, qns)
if Movie in entity_list:
final_reply += get_favorite(entity_list, qns)
if Places in entity_list:
final_reply += get_favorite(entity_list, qns)
if Weed in entity_list:
final_reply += get_weed(entity_list, qns)
if Relationship in entity_list:
final_reply += get_relation(entity_list, qns)
if Virgin in entity_list:
final_reply += get_virginity(entity_list, qns)
if LoveLife in entity_list:
final_reply += get_LoveLife(entity_list, qns)
if Show in entity_list:
final_reply += get_favorite(entity_list, qns)
if Sports in entity_list:
final_reply += get_favorite(entity_list, qns)
if Favorite in entity_list and Person in entity_list:
final_reply += get_favorite(entity_list, qns)
if final_reply == '':
return "Sorry the A.I does not know how to answer that, yet."
return final_reply
def main():
print(get_reply("How tall are you?"))
if __name__ == '__main__':
main()