Skip to content

Commit 1cd22ba

Browse files
committed
Update pronounce.py
1 parent 7ddeb04 commit 1cd22ba

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

pythainlp/util/pronounce.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@
2020

2121

2222
kv = KhaveeVerifier()
23-
all_thai_words_dict = [i for i in list(thai_words()) if len(syllable_tokenize(i))==1]
23+
all_thai_words_dict = [
24+
i for i in list(thai_words()) if len(syllable_tokenize(i)) == 1
25+
]
2426

2527

26-
def rhyme(word: str)->List[str]:
28+
def rhyme(word: str) -> List[str]:
2729
"""
2830
Find Thai rhyme
2931
@@ -38,8 +40,8 @@ def rhyme(word: str)->List[str]:
3840
print(rhyme("จีบ"))
3941
# output: ['กลีบ', 'กีบ', 'ครีบ', ...]
4042
"""
41-
list_sumpus=[]
43+
list_sumpus = []
4244
for i in all_thai_words_dict:
43-
if kv.is_sumpus(word,i) and i!=word:
45+
if kv.is_sumpus(word, i) and i != word:
4446
list_sumpus.append(i)
4547
return sorted(list_sumpus)

0 commit comments

Comments
 (0)