Last active
June 30, 2017 15:08
-
-
Save korakot/8708542c84c08081bcd3389039b16254 to your computer and use it in GitHub Desktop.
ตรวจคำสะกด โดยทำ word list เอง
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ลง hunspell + python ไม่สำเร็จ | |
# แต่มาเจอ pyenchant ที่ใช้ได้เหมือนกัน และมี custom word list ด้วย | |
>>> import enchant | |
>>> pwl = enchant.request_pwl_dict("royin_2542_wordlist.txt") | |
>>> pwl.check("กรกฎ") | |
True | |
>>> pwl.check("กรกำ") | |
False | |
>>> pwl.suggest("กรกำ") | |
['กรก', 'กรกฎ', 'กรกฏ', 'กรกช', 'กรำ', 'กร่ำ'] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment