Lug
Advertisement

จาก http://groups.google.com/group/thai-linux-foss-devel/browse_thread/thread/3fc20f7146ab2105?hl=th,

ควรจะมีแป้นที่กํากับการตัดคําหรือไม่(ผู้ที่ทําPluginในการตัดคําเช่นASKและFreelockใช้ZeroWidthSpace)ดังนั้นในการพิมพ์
เอกสารเราควรจะพิมพ์1คําแล้วกดSpaceเหมือนภาษาอังกฤษเพ่อที่จะได้ช่วยบังคับการตัดคําให้ดีขึ้นเราไม่จําเป็นตัองยึดรูปแบบ

จะเสนอ idea เพิ่มเติมสำหรับ IM ใน mode ตัดคำ คือ,

  1. ถ้าต้องการ insert space จริงๆ ให้กด space 2 ที
  2. ถ้าเป็น space ตามด้วย non thai consonant จะหมายถึง space จริงๆ

informal pattern[]

ถ้ากำหนดให้

  • [[:thai end:]] = [ก-ฮฯ-<phinthu U+0E3A>ๅ-<yamakkan U+0E4E>]
  • [[:thai begin:]] = [ก-ฮฯเ-ไ]

จะเขียนเป็น pattern คร่าวๆ ดังนี้,

  • [[:thai end:]]<space>[[:thai begin:]] --> [...]<zwsp>[...]
  • [[:thai end:]]<space><space>[[:thai begin:]] --> [...]<space>[...]
  • [[:thai end:]]<space>[^[:thai begin:]] --> [...]<space>[...]
  • [^[:thai end:]]<space>[[:thai begin:]] --> [...]<space>[...]
  • [^[:thai end:]]<space>[^[:thai begin:]] --> [...]<space>[...]

หมายเหตุ: สำหรับเลขไทย ๐-๙ ที่มี space คั่นจะไม่จัดให้เป็น zwsp

state machine[]

ถ้าเขียนเป็น formal ด้วย state machine,

กำหนดให้,

  • [[:thai end*begin:]] = [[:thai begin*end:]] = [ก-ฮฯ] ([[:thai end:]] intersect [[:thai begin:]])
  • [[:thai end-begin:]] = [ะ-<phinthu U+0E3A>ๅ-<yamakkan U+0E4E>] ([[:thai end:]] exclude [[:thai begin:]])
  • [[:thai begin-end:]] = [เ-ไ] ([[:thai begin:]] exclude [[:thai end:]])
  • <lamda> หรือ <eof> = end of input

เริ่มต้นที่ start state,

start:
  • [[:thai end:]] --> print ch, goto thai_end
  • <space> --> print <space>, goto start
  • other --> print ch, goto start
thai_end:
  • <space> --> (print nothing) goto thai_end_space
  • [[:thai end:]] --> print ch, goto thai_end
  • other --> print ch, goto start
thai_end_space:
  • [[:thai begin-end:]] --> print <zwsp>, print ch, goto start
  • [[:thai begin*end:]] --> print <zwsp>, print ch, goto thai_end
  • <space> --> print <space>, goto start
  • <eof> --> print <space>, goto end
  • other --> print <space>, print ch, goto start

นอกจากนี้ ยังมีกรณีที่เป็น consonant ตัวเดียวโดดๆ เช่น, "ณ ที่นี้", ก็ไม่น่าจะแปลง space เป็น zwsp. กรณีนี้คงต้องเพิ่ม state เข้าไปอีก.

ข้อมูลที่เกี่ยวข้อง[]

Advertisement