Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
|
@@ -72,16 +72,137 @@ def check_custom_responses(message: str) -> str:
|
|
| 72 |
"""Check for specific patterns and return custom responses."""
|
| 73 |
message_lower = message.lower()
|
| 74 |
custom_responses = {
|
|
|
|
| 75 |
"what is ur name?": "xylaria",
|
| 76 |
-
"what is
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 77 |
"what's your name?": "xylaria",
|
| 78 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 79 |
"how many 'r' is in strawberry?": "3",
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 80 |
"who is your developer?": "sk md saad amin",
|
| 81 |
-
"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 82 |
"who is ur dev": "sk md saad amin",
|
| 83 |
-
"who is ur
|
|
|
|
|
|
|
|
|
|
|
|
|
| 84 |
}
|
|
|
|
| 85 |
for pattern, response in custom_responses.items():
|
| 86 |
if pattern in message_lower:
|
| 87 |
return response
|
|
|
|
| 72 |
"""Check for specific patterns and return custom responses."""
|
| 73 |
message_lower = message.lower()
|
| 74 |
custom_responses = {
|
| 75 |
+
# For "what is ur name?"
|
| 76 |
"what is ur name?": "xylaria",
|
| 77 |
+
"what is ur Name?": "xylaria",
|
| 78 |
+
"what is Ur name?": "xylaria",
|
| 79 |
+
"what is Ur Name?": "xylaria",
|
| 80 |
+
"What is ur name?": "xylaria",
|
| 81 |
+
"What is ur Name?": "xylaria",
|
| 82 |
+
"What is Ur name?": "xylaria",
|
| 83 |
+
"What is Ur Name?": "xylaria",
|
| 84 |
+
"what's ur name?": "xylaria",
|
| 85 |
+
"what's ur Name?": "xylaria",
|
| 86 |
+
"what's Ur name?": "xylaria",
|
| 87 |
+
"what's Ur Name?": "xylaria",
|
| 88 |
+
"whats ur name?": "xylaria",
|
| 89 |
+
"whats ur Name?": "xylaria",
|
| 90 |
+
"whats Ur name?": "xylaria",
|
| 91 |
+
"whats Ur Name?": "xylaria",
|
| 92 |
"what's your name?": "xylaria",
|
| 93 |
+
"what's your Name?": "xylaria",
|
| 94 |
+
"what's Your name?": "xylaria",
|
| 95 |
+
"what's Your Name?": "xylaria",
|
| 96 |
+
"Whats ur name?": "xylaria",
|
| 97 |
+
"Whats ur Name?": "xylaria",
|
| 98 |
+
"Whats Ur name?": "xylaria",
|
| 99 |
+
"Whats Ur Name?": "xylaria",
|
| 100 |
+
"What Is Your Name?": "xylaria",
|
| 101 |
+
"What Is Ur Name?": "xylaria",
|
| 102 |
+
"What Is Your Name?": "xylaria",
|
| 103 |
+
"What Is Ur Name?": "xylaria",
|
| 104 |
+
"what is your name?": "xylaria",
|
| 105 |
+
"what is your Name?": "xylaria",
|
| 106 |
+
"what is Your name?": "xylaria",
|
| 107 |
+
"what is Your Name?": "xylaria",
|
| 108 |
+
|
| 109 |
+
# For "how many 'r' is in strawberry?"
|
| 110 |
"how many 'r' is in strawberry?": "3",
|
| 111 |
+
"how many 'R' is in strawberry?": "3",
|
| 112 |
+
"how many 'r' Is in strawberry?": "3",
|
| 113 |
+
"how many 'R' Is in strawberry?": "3",
|
| 114 |
+
"How many 'r' is in strawberry?": "3",
|
| 115 |
+
"How many 'R' is in strawberry?": "3",
|
| 116 |
+
"How Many 'r' Is In Strawberry?": "3",
|
| 117 |
+
"How Many 'R' Is In Strawberry?": "3",
|
| 118 |
+
"how many r is in strawberry?": "3",
|
| 119 |
+
"how many R is in strawberry?": "3",
|
| 120 |
+
"how many r Is in strawberry?": "3",
|
| 121 |
+
"how many R Is in strawberry?": "3",
|
| 122 |
+
"How many r is in strawberry?": "3",
|
| 123 |
+
"How many R is in strawberry?": "3",
|
| 124 |
+
"How Many R Is In Strawberry?": "3",
|
| 125 |
+
"how many 'r' in strawberry?": "3",
|
| 126 |
+
"how many r's are in strawberry?": "3",
|
| 127 |
+
"how many Rs are in strawberry?": "3",
|
| 128 |
+
"How Many R's Are In Strawberry?": "3",
|
| 129 |
+
"How Many Rs Are In Strawberry?": "3",
|
| 130 |
+
|
| 131 |
+
# For "who is your developer?"
|
| 132 |
"who is your developer?": "sk md saad amin",
|
| 133 |
+
"who is your Developer?": "sk md saad amin",
|
| 134 |
+
"who is Your Developer?": "sk md saad amin",
|
| 135 |
+
"who is ur developer?": "sk md saad amin",
|
| 136 |
+
"who is ur Developer?": "sk md saad amin",
|
| 137 |
+
"who is Your Developer?": "sk md saad amin",
|
| 138 |
+
"Who is ur developer?": "sk md saad amin",
|
| 139 |
+
"Who is ur Developer?": "sk md saad amin",
|
| 140 |
+
"who is ur dev?": "sk md saad amin",
|
| 141 |
+
"Who is ur dev?": "sk md saad amin",
|
| 142 |
+
"who is your dev?": "sk md saad amin",
|
| 143 |
+
"Who is your dev?": "sk md saad amin",
|
| 144 |
+
"Who's your developer?": "sk md saad amin",
|
| 145 |
+
"Who's ur developer?": "sk md saad amin",
|
| 146 |
+
"Who Is Your Developer?": "sk md saad amin",
|
| 147 |
+
"Who Is Ur Developer?": "sk md saad amin",
|
| 148 |
+
"Who Is Your Dev?": "sk md saad amin",
|
| 149 |
+
"Who Is Ur Dev?": "sk md saad amin",
|
| 150 |
+
"who's your developer?": "sk md saad amin",
|
| 151 |
+
"who's ur developer?": "sk md saad amin",
|
| 152 |
+
"who is your devloper?": "sk md saad amin", # misspelled
|
| 153 |
+
"who is ur devloper?": "sk md saad amin", # misspelled
|
| 154 |
+
|
| 155 |
+
# For "how many r is in strawberry?"
|
| 156 |
+
"how many r is in strawberry?": "3",
|
| 157 |
+
"how many R is in strawberry?": "3",
|
| 158 |
+
"how many r Is in strawberry?": "3",
|
| 159 |
+
"how many R Is in strawberry?": "3",
|
| 160 |
+
"How many r is in strawberry?": "3",
|
| 161 |
+
"How many R is in strawberry?": "3",
|
| 162 |
+
"How Many R Is In Strawberry?": "3",
|
| 163 |
+
"how many 'r' is in strawberry?": "3",
|
| 164 |
+
"how many 'R' is in strawberry?": "3",
|
| 165 |
+
"how many 'r' Is in strawberry?": "3",
|
| 166 |
+
"how many 'R' Is in strawberry?": "3",
|
| 167 |
+
"How many 'r' is in strawberry?": "3",
|
| 168 |
+
"How many 'R' is in strawberry?": "3",
|
| 169 |
+
"How Many 'r' Is In Strawberry?": "3",
|
| 170 |
+
"How Many 'R' Is In Strawberry?": "3",
|
| 171 |
+
"how many r's are in strawberry?": "3",
|
| 172 |
+
"how many Rs are in strawberry?": "3",
|
| 173 |
+
"How Many R's Are In Strawberry?": "3",
|
| 174 |
+
"How Many Rs Are In Strawberry?": "3",
|
| 175 |
+
"how many Rs's are in strawberry?": "3",
|
| 176 |
+
|
| 177 |
+
# More informal and non-standard variations
|
| 178 |
+
"wat is ur name?": "xylaria",
|
| 179 |
+
"wat is ur Name?": "xylaria",
|
| 180 |
+
"wut is ur name?": "xylaria",
|
| 181 |
+
"wut ur name?": "xylaria",
|
| 182 |
+
"wats ur name?": "xylaria",
|
| 183 |
+
"wats ur name": "xylaria",
|
| 184 |
+
"who's ur dev?": "sk md saad amin",
|
| 185 |
+
"who's your dev?": "sk md saad amin",
|
| 186 |
+
"who ur dev?": "sk md saad amin",
|
| 187 |
+
"who's ur devloper?": "sk md saad amin", # misspelled
|
| 188 |
+
"how many r in strawbary?": "3",
|
| 189 |
+
"how many r in strawbary?": "3",
|
| 190 |
+
"how many R in strawbary?": "3",
|
| 191 |
+
"how many 'r' in strawbary?": "3",
|
| 192 |
+
"how many 'R' in strawbary?": "3",
|
| 193 |
+
"how many r in strawbry?": "3",
|
| 194 |
+
"how many R in strawbry?": "3",
|
| 195 |
+
"how many r is in strawbry?": "3",
|
| 196 |
+
"how many 'r' is in strawbry?": "3",
|
| 197 |
+
"how many 'R' is in strawbry?": "3",
|
| 198 |
"who is ur dev": "sk md saad amin",
|
| 199 |
+
"who is ur devloper": "sk md saad amin", # misspelled
|
| 200 |
+
"what is ur dev": "sk md saad amin",
|
| 201 |
+
"who is ur dev?": "sk md saad amin",
|
| 202 |
+
"who is ur dev?": "sk md saad amin",
|
| 203 |
+
"whats ur dev?": "sk md saad amin",
|
| 204 |
}
|
| 205 |
+
|
| 206 |
for pattern, response in custom_responses.items():
|
| 207 |
if pattern in message_lower:
|
| 208 |
return response
|