-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathrespones_data.py
122 lines (118 loc) · 2.4 KB
/
respones_data.py
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
# *=============== Keyword Dictionarys
#! PLEASE ADD KEYWORD IN SMALL CASE
exit_list = ["exit", "bye", "good bye"]
web_command_list = ["web browser","webbrowser","browser"]
sleep_word_list = ["wait"]
wakeup_word_list = ["wake", "wake up", "are you there"]
no_words = [
"no",
"nope",
"nah",
"negative",
"not really",
"nay",
"never",
"absolutely not",
"certainly not",
"of course not",
"not at all",
"decline",
"refuse",
"reject",
"deny",
"veto",
"disagree",
"disapprove",
"incorrect",
"wrong",
"false",
"untrue",
"unacceptable",
"impossible",
"inadmissible",
"improbable",
"hardly",
"scarcely",
"barely",
"not necessarily",
"not likely",
"not possible",
"no way",
"by no means",
"far from it",
"under no circumstances",
"dont",
]
yes_words = [
"yes",
"yeah",
"yep",
"yup",
"sure",
"absolutely",
"affirmative",
"indeed",
"okay",
"ok",
"aye",
"certainly",
"definitely",
"roger",
"fine",
"alright",
"positive",
"confirmed",
"exactly",
"right",
"agreed",
"accepted",
"true",
"good",
"fine",
"fine with me",
"fine by me",
"of course",
"totally",
"without a doubt",
"sure thing",
"you bet",
"why not",
"great",
"perfect",
"no problem",
"all right",
"please",
"please do",
"please proceed",
"certainly",
"absolutely",
"indeed",
"undoubtedly",
"without question",
"affirmative",
"very well",
"by all means",
"correct",
"precisely",
"of course",
"right away",
"surely",
]
def remove_word_before(input_string,word):
words = input_string.split()
try:
index = words.index(word)
words = words[index+1:] # Start from the word after the specified word
except ValueError:
pass # Word not found, or it's the first word
return ' '.join(words)
def get_keywords(filename,text):
import json
with open(filename, 'r') as f:
# Load the data
data = json.load(f)
for keys in data:
keywords=(data[keys]).lower()
if all(word in text for word in keywords):
keys=keys.split("+")
return(keys)