pythainlp icon indicating copy to clipboard operation
pythainlp copied to clipboard

คำสะกดไม่ถูก

Open phitcphu opened this issue 3 years ago • 5 comments

คำว่า ปลาอินทรีย์ ไม่ถูกแก้ให้ถูกเป็น ปลาอินทรี

phitcphu avatar Jun 20 '22 07:06 phitcphu

Hello @tuakapiak, thank you for your interest in our work!

If this is a bug report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.

github-actions[bot] avatar Jun 20 '22 07:06 github-actions[bot]

CheckSpell

phitcphu avatar Jun 20 '22 08:06 phitcphu

อันนี้ตัวแก้คำผิดจะดึง dict มาใช้งานนะครับ ไม่แน่ เราอาจจะแก้โดยเพิ่ม dict คำที่ถูกต้อง ที่ไม่มีคำผิดเลยมาใช้งานกับฟังก์ชันนี้ คุณ @bact คิดเห็นว่าอย่างไรครับ

wannaphong avatar Aug 06 '22 09:08 wannaphong

ตัวพจนานุกรมมาตรฐานที่ใช้อยู่ตอนนี้ มาจาก Thai National Corpus

https://github.com/PyThaiNLP/pythainlp/blob/39b814a9dcfafb516561844f89895d5be4cc2999/pythainlp/spell/pn.py#L167-L168

ซึ่งจะเก็บคำตามที่ปรากฏในภาษา รวมถึงคำที่สะกดผิดด้วย

ในอนาคต ควรจะมีพจนานุกรมที่มีเฉพาะคำที่สะกดถูก

ในระหว่างนี้ สามารถสร้าง spellchecker ขึ้นได้เอง จาก class NorvigSpellChecker และส่งพจนานุกรม ที่มีเฉพาะคำที่ถูกเข้าไปครับ

bact avatar Oct 11 '22 06:10 bact