@@ -113,10 +113,6 @@ def check_sara(self, word: str)-> str:
113113 sara .remove ('เอ' )
114114 sara .remove ('อิ' )
115115 sara .append ('เออ' )
116- elif 'เอะ' in sara and 'อา' in sara :
117- sara .remove ('เอะ' )
118- sara .remove ('ออ' )
119- sara .append ('เอาะ' )
120116 elif 'เอ' in sara and 'ออ' in sara and 'อ' in word [- 1 ]:
121117 sara .remove ('เอ' )
122118 sara .remove ('ออ' )
@@ -137,6 +133,9 @@ def check_sara(self, word: str)-> str:
137133 sara .remove ('เอ' )
138134 sara .remove ('อา' )
139135 sara .append ('เอา' )
136+ elif 'เ' in word and 'า' in word and 'ะ' in word :
137+ sara = []
138+ sara .append ('เอาะ' )
140139 if 'อือ' in sara and 'เออ' in sara :
141140 sara .remove ('เออ' )
142141 sara .remove ('อือ' )
@@ -164,6 +163,9 @@ def check_sara(self, word: str)-> str:
164163 elif word == 'เอา' :
165164 sara = []
166165 sara .append ('เอา' )
166+ elif word == 'เอาะ' :
167+ sara = []
168+ sara .append ('เอาะ' )
167169 if 'ฤา' in word or 'ฦา' in word :
168170 sara = []
169171 sara .append ('อือ' )
@@ -178,6 +180,7 @@ def check_sara(self, word: str)-> str:
178180 sara .append ('ออ' )
179181 elif sara == [] and len (word ) == 3 :
180182 sara .append ('ออ' )
183+
181184 if sara == []:
182185 return 'Cant find Sara in this word'
183186 else :
@@ -309,7 +312,7 @@ def check_klon(self, text: str,k_type: int=8) -> Union[List[str], str]:
309312 list_sumpus_sent3 = []
310313 list_sumpus_sent4 = []
311314 for i , sent in enumerate (text .split ()):
312- sub_sent = subword_tokenize (sent , engine = 'dict' )
315+ sub_sent = subword_tokenize (sent ,engine = 'dict' )
313316 # print(i)
314317 if len (sub_sent ) > 10 :
315318 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]:
343346 else :
344347 return error
345348 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 .'
347350 elif k_type == 4 :
348351 try :
349352 error = []
@@ -353,7 +356,7 @@ def check_klon(self, text: str,k_type: int=8) -> Union[List[str], str]:
353356 list_sumpus_sent3 = []
354357 list_sumpus_sent4 = []
355358 for i , sent in enumerate (text .split ()):
356- sub_sent = subword_tokenize (sent , engine = 'dict' )
359+ sub_sent = subword_tokenize (sent ,engine = 'dict' )
357360 if len (sub_sent ) > 5 :
358361 error .append ('In the sentence' + str (i + 2 )+ 'there are more than 4 words.' + str (sub_sent ))
359362 if (i + 1 ) % 4 == 1 :
0 commit comments