Wrapper ตัดคำไทย
Submitted by willwill on 23 October, 2008 - 20:22.
tags:
เขียนเอาไว้ใช้กับ IRC Bot ครับ เลยเอามาแจกกัน http://whsgroup.ath.cx/~whs/thbrk.txt
Functions
Libthai
- th_brk จะ wrap th_brk ของ libthai
- th_brk_line จะ wrap th_brk_line ของ libthai โดยใช้ seperator เป็น “|” ครับ
PyICU (sudo apt-get install pyicu)
- icu_break จะเรียกใช้ BreakIterator ของ ICU ครับ return เหมือนกัน th_brk_line ครับ
Silverbullet
- sb จะใช้ function Silverbullet ของ bow_der_klein ครับ
การใช้งานทุก function ขั้นต่ำคือ input เป็น unicode ครับ output
- th_brk จะเป็นตำแหน่งที่ตัด (list)
- th_brk_line และอื่นๆ เป็น unicode string โดยจุดที่ตัด จะคั่นด้วย | ครับ




