diff --git a/pythainlp/khavee/core.py b/pythainlp/khavee/core.py index 1eede7006..1dfa7e6d1 100644 --- a/pythainlp/khavee/core.py +++ b/pythainlp/khavee/core.py @@ -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: diff --git a/pythainlp/khavee/example.py b/pythainlp/khavee/example.py index ad1726fa2..cd123d7b3 100644 --- a/pythainlp/khavee/example.py +++ b/pythainlp/khavee/example.py @@ -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