Skip to content

Commit

Permalink
Merge pull request #798 from kangkengkhadev/dev
Browse files Browse the repository at this point in the history
fixed bug
  • Loading branch information
wannaphong committed May 17, 2023
2 parents a116136 + f906d15 commit 90c446e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions pythainlp/khavee/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,12 @@ def check_sara(self, word: str)-> str:
sara.append('ออ')

# incase บ่
if 'บ่' in word:
if 'บ่' == word:
sara = []
sara.append('ออ')

if 'ํ' in word:
sara = []
sara.append('อำ')
if sara == []:
return 'Cant find Sara in this word'
else:
Expand Down
3 changes: 2 additions & 1 deletion pythainlp/khavee/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@
# True

# การตรวจสอบคำสำผัสที่ผิด
print('สรร ขวาน',kv.is_sumpus('สรร','ขวาน'))
print('นํ้า กา',kv.is_sumpus('นํ้า','กา'))
# False

# การตรวจสอบคำ ครุ ลหุ
print('สรร',kv.check_karu_lahu('สรร'))
#karu

# การตรวจสอบคำ ครุ ลหุ
print('ชิชะ',kv.check_karu_lahu('ชิชะ'))
# lahu
Expand Down

0 comments on commit 90c446e

Please sign in to comment.