Update main.py
Browse files
main.py
CHANGED
@@ -106,15 +106,21 @@ async def check_word(data: WordCheckData) -> Dict[str, Any]:
|
|
106 |
for words in forms.values():
|
107 |
all_forms.update(words)
|
108 |
|
109 |
-
|
110 |
-
|
111 |
found = False
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
118 |
|
119 |
result = {
|
120 |
"found": found
|
|
|
106 |
for words in forms.values():
|
107 |
all_forms.update(words)
|
108 |
|
109 |
+
# Initialize found flag
|
|
|
110 |
found = False
|
111 |
+
|
112 |
+
# Split the input string into words
|
113 |
+
input_words = input_string.split()
|
114 |
+
|
115 |
+
# Loop through each word in the input string
|
116 |
+
for input_word in input_words:
|
117 |
+
# Strip the word to contain only alphabetic characters
|
118 |
+
input_word = ''.join(filter(str.isalpha, input_word))
|
119 |
+
|
120 |
+
# Check if the stripped word is equal to any of the forms
|
121 |
+
if input_word in all_forms:
|
122 |
+
found = True
|
123 |
+
break # Exit loop if word is found
|
124 |
|
125 |
result = {
|
126 |
"found": found
|