Skip to content

Commit 7321c36

Browse files
authored
Merge pull request #795 from HRNPH/dev
adding tonemark removal to fix mattra checking
2 parents 52ff97e + 38c0b1c commit 7321c36

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pythainlp/khavee/core.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
from typing import List, Union
1616
from pythainlp.tokenize import subword_tokenize
1717
from pythainlp.util import sound_syllable
18-
18+
from pythainlp.util import remove_tonemark
1919
class KhaveeVerifier:
2020
def __init__(self):
2121
"""
@@ -215,6 +215,7 @@ def check_marttra(self, word: str) -> str:
215215
if word[-1] == 'ร' and word[-2] in ['ต','ท'] :
216216
word = word[:-1]
217217
word = self.handle_karun_sound_silence(word)
218+
word = remove_tonemark(word)
218219
if 'ำ' in word or ('ํ' in word and 'า' in word) or 'ไ' in word or 'ใ' in word:
219220
return 'กา'
220221
elif word[-1] in ['า','ะ','ิ','ี','ุ','ู','อ'] or ('ี' in word and 'ย' in word[-1]) or ('ื' in word and 'อ' in word[-1]):

0 commit comments

Comments
 (0)