Skip to content

Commit 8d9e319

Browse files
committed
fix karun function name & parameters
1 parent 485b12d commit 8d9e319

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pythainlp/khavee/core.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def check_marttra(self, word: str) -> str:
214214
"""
215215
if word[-1] == 'ร' and word[-2] in ['ต','ท'] :
216216
word = word[:-1]
217-
word = self.handle_karun_sound_silenced(word)
217+
word = self.handle_karun_sound_silence(word)
218218
if 'ำ' in word or ('ํ' in word and 'า' in word) or 'ไ' in word or 'ใ' in word:
219219
return 'กา'
220220
elif word[-1] in ['า','ะ','ิ','ี','ุ','ู','อ'] or ('ี' in word and 'ย' in word[-1]) or ('ื' in word and 'อ' in word[-1]):
@@ -448,7 +448,7 @@ def check_aek_too(self, text: Union[List[str], str], dead_syllable_as_aek:bool =
448448
else:
449449
return False
450450

451-
def handle_karun_sound_silence(text: str) -> str:
451+
def handle_karun_sound_silence(self, word: str) -> str:
452452
"""
453453
Handle sound silence in Thai word using '์' character (Karun)
454454
by stripping all the characters before the 'Karun' character that should be silenced
@@ -459,7 +459,7 @@ def handle_karun_sound_silence(text: str) -> str:
459459
"""
460460
sound_silenced = True if word.endswith('์') else False
461461
if not sound_silenced:
462-
return text
462+
return word
463463
thai_consonants = "กขฃคฅฆงจฉชซฌญฎฏฐฑฒณดตถทธนบปผฝพฟภมยรลวศษสหฬอฮ"
464464
locate_silenced = word.rfind('์') - 1
465465
can_silence_two = True if word[locate_silenced-2] in thai_consonants else False

0 commit comments

Comments
 (0)