-
Notifications
You must be signed in to change notification settings - Fork 277
อยากเพิ่มคำใน pythainlp.spell ครับ #119
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
ทำได้โดยการเพิ่มคำลงไฟล์ https://github.com/PyThaiNLP/pythainlp/blob/dev/pythainlp/corpus/thaiword.txt ครับ |
ในไฟล์ thaiword.txt เราจำเป็นต้องเรียงตามพจนานุกรมไหมครับผม ขอบคุณครับ |
ไม่ครับ |
hunspell นี้เราจะไม่สามารถ fix คำที่ต้องการแก้ใช้ไหมครับ ถ้ามี set คำที่เราต้องการแก้จำกัดอยู่แล้ว ใช้แค่ engine pn เพียงพอแล้วใช้ไหมครับ |
ใช่ครับ |
น่าจะได้คำตอบแล้ว |
จากการแก้ไข #137 จะทำให้การแก้ไขไฟล์ thaiword.txt ไม่มีผลต่อการทำงานของ pythainlp.corpus.pn.spell() TODO: เพิ่ม spell checker class เพื่อให้ผู้ใช้สามารถระบุรายการคำ (พจนานุกรม) ได้เอง |
ตอนนี้สามารถเขียนโปรแกรมปรับเปลี่ยนพจนานุกรมได้เองแล้วนะครับ from pythainlp.spell.pn import NorvigSpellChecker
mydict = [("นก", 35), ("หนู", 20)]
checker = NorvigSpellChecker(custom_dict=mydict)
checker.spell("นภ") ดูตัวอย่างการใช้งานที่ |
สวัสดีครับผม จากที่ได้ทดสอบ โปรแกรมสามารถแก้คำผิดพวกจังหวัดได้ดีมาก แต่ยังไม่สามารถแก้เขต แขวง ได้ ผมสามารถสร้าง dict ลงให้เพิ่มให้ตัวโปรแกรมได้ไหมคครับ
The text was updated successfully, but these errors were encountered: