@@ -113,10 +113,6 @@ def check_sara(self, word: str)-> str:
113
113
sara .remove ('เอ' )
114
114
sara .remove ('อิ' )
115
115
sara .append ('เออ' )
116
- elif 'เอะ' in sara and 'อา' in sara :
117
- sara .remove ('เอะ' )
118
- sara .remove ('ออ' )
119
- sara .append ('เอาะ' )
120
116
elif 'เอ' in sara and 'ออ' in sara and 'อ' in word [- 1 ]:
121
117
sara .remove ('เอ' )
122
118
sara .remove ('ออ' )
@@ -137,6 +133,9 @@ def check_sara(self, word: str)-> str:
137
133
sara .remove ('เอ' )
138
134
sara .remove ('อา' )
139
135
sara .append ('เอา' )
136
+ elif 'เ' in word and 'า' in word and 'ะ' in word :
137
+ sara = []
138
+ sara .append ('เอาะ' )
140
139
if 'อือ' in sara and 'เออ' in sara :
141
140
sara .remove ('เออ' )
142
141
sara .remove ('อือ' )
@@ -164,6 +163,9 @@ def check_sara(self, word: str)-> str:
164
163
elif word == 'เอา' :
165
164
sara = []
166
165
sara .append ('เอา' )
166
+ elif word == 'เอาะ' :
167
+ sara = []
168
+ sara .append ('เอาะ' )
167
169
if 'ฤา' in word or 'ฦา' in word :
168
170
sara = []
169
171
sara .append ('อือ' )
@@ -178,6 +180,7 @@ def check_sara(self, word: str)-> str:
178
180
sara .append ('ออ' )
179
181
elif sara == [] and len (word ) == 3 :
180
182
sara .append ('ออ' )
183
+
181
184
if sara == []:
182
185
return 'Cant find Sara in this word'
183
186
else :
@@ -309,7 +312,7 @@ def check_klon(self, text: str,k_type: int=8) -> Union[List[str], str]:
309
312
list_sumpus_sent3 = []
310
313
list_sumpus_sent4 = []
311
314
for i , sent in enumerate (text .split ()):
312
- sub_sent = subword_tokenize (sent , engine = 'dict' )
315
+ sub_sent = subword_tokenize (sent ,engine = 'dict' )
313
316
# print(i)
314
317
if len (sub_sent ) > 10 :
315
318
error .append ('In the sentence' + str (i + 2 )+ 'there are more than 10 words.' + str (sub_sent ))
@@ -343,7 +346,7 @@ def check_klon(self, text: str,k_type: int=8) -> Union[List[str], str]:
343
346
else :
344
347
return error
345
348
except :
346
- return 'Something went wrong Make sure you enter it in correct form of klon4 .'
349
+ return 'Something went wrong Make sure you enter it in correct form of klon 8 .'
347
350
elif k_type == 4 :
348
351
try :
349
352
error = []
@@ -353,7 +356,7 @@ def check_klon(self, text: str,k_type: int=8) -> Union[List[str], str]:
353
356
list_sumpus_sent3 = []
354
357
list_sumpus_sent4 = []
355
358
for i , sent in enumerate (text .split ()):
356
- sub_sent = subword_tokenize (sent , engine = 'dict' )
359
+ sub_sent = subword_tokenize (sent ,engine = 'dict' )
357
360
if len (sub_sent ) > 5 :
358
361
error .append ('In the sentence' + str (i + 2 )+ 'there are more than 4 words.' + str (sub_sent ))
359
362
if (i + 1 ) % 4 == 1 :
0 commit comments