<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress.com" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	>

<channel>
	<title>word-segmentation &amp;laquo; WordPress.com Tag Feed</title>
	<link>http://wordpress.com/tag/word-segmentation/</link>
	<description>Feed of posts on WordPress.com tagged "word-segmentation"</description>
	<pubDate>Fri, 29 Aug 2008 19:13:37 +0000</pubDate>

	<generator>http://wordpress.com/tags/</generator>
	<language>en</language>

<item>
<title><![CDATA[แนวทางในการแก้ให้ ICU ตัดคำภาษาลาวได้]]></title>
<link>http://openil.wordpress.com/?p=318</link>
<pubDate>Thu, 19 Jun 2008 09:56:46 +0000</pubDate>
<dc:creator>वीर</dc:creator>
<guid>http://openil.wordpress.com/?p=318</guid>
<description><![CDATA[หลังจากที่ได้ word list จาก au8ust มาผมก็ยังไม]]></description>
<content:encoded><![CDATA[<p>หลังจากที่ได้ word list จาก <a href="http://au8ust.org/">au8ust</a> มาผมก็ยังไม่ได้ทำอะไรกับ word list เลย. แต่เท่าที่ดูแล้วโปรแกรมที่แก้แล้วน่าจะมีประโยชน์กับหลายๆโปรแกรมน่าจะเป็น <a href="http://www.icu-project.org/">icu</a>. อย่างเช่น OpenOffice.org เป็นต้น (แต่ก็ไม่รู้ว่าจริงหรือเปล่า) </p>
<p>หลังจากที่ดูคร่าวๆ แล้วไฟล์แรกที่น่าจะต้องแก้น่าจะเป็น source/common/dictbe.h ที่ในนั้นมี ThaiBreakEngine อยู่ ก็เลยคิดว่าก็คงต้องมี LaoBreakEngine ด้วยเหมือนกัน แก้กฎข้างในเล็กๆ น้อยๆ พวกไม้ยมก ก็คงจะไม่เหมือนกันหรือเปล่า ...  อันนี้ก็ไปแก้ใน source/common/dictbe.cpp  </p>
<p>ตอนนี้แผนต่อไปก็คงต้องลงมือทำดูพร้อมเขียน test อะไรประมาณนั้น</p>
<p>ป.ล. libthai ก็ดูน่าสนใจดี มีใช้หลายโปรแกรมเหมือนกัน แต่ libthai ตัดคำภาษาลาวด้วยก็ดูแปลกๆ หรือเปล่า?</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[ตัดคำโดยใช้ Python และ ICU]]></title>
<link>http://openil.wordpress.com/?p=144</link>
<pubDate>Mon, 03 Mar 2008 15:14:04 +0000</pubDate>
<dc:creator>वीर</dc:creator>
<guid>http://openil.wordpress.com/?p=144</guid>
<description><![CDATA[ผมดูตัวอย่างมาจาก http://www.thaitux.info/node/194.  ผมเล]]></description>
<content:encoded><![CDATA[<p>ผมดูตัวอย่างมาจาก <a href="http://www.thaitux.info/node/194">http://www.thaitux.info/node/194</a>.  ผมเลยมาเขียน version ของผมบ้าง เพื่อที่จะเอามาเตรียม corpus สำหรับ bilingual word matching (alignment).</p>
<p>[sourcecode language='python']<br />
#-*- coding: UTF-8 -*-<br />
import sys<br />
import PyICU</p>
<p># split_words was inspired by an example in http://www.thaitux.info/node/194</p>
<p>def is_tha(c):<br />
	return ord(c) >= 0x0E00 and ord(c) <= 0x0E7F</p>
<p>def merge(ans, tok):<br />
	if is_tha(tok[0]) or len(ans[:-1]) == 0 or is_tha(ans[-1][0]):<br />
		return ans + [tok]<br />
	else:<br />
		return ans[:-1] + [ans[-1] + tok]</p>
<p>def split_words(txt):<br />
	icu_txt = PyICU.UnicodeString(txt)<br />
	brk_iter = PyICU.BreakIterator.createWordInstance(PyICU.Locale("th"))<br />
	brk_iter.setText(icu_txt)<br />
	brk_e = [i for i in brk_iter]<br />
	brk_s = [0] + brk_e[:-1]<br />
	ans = [unicode(icu_txt[i[0]:i[1]]) for i in zip(brk_s, brk_e)]<br />
	return filter(lambda t: t != "", reduce(merge, ans, []))</p>
<p>def main():<br />
	reload(sys)<br />
	sys.setdefaultencoding('utf-8')<br />
	print split_words("ทดลองทดลอง 5%")</p>
<p>if __name__ == '__main__':<br />
	main() </p>
<p>[/sourcecode]<br />
ผลออกมาได้ [u'u0e17u0e14u0e25u0e2du0e07', u'u0e17u0e14u0e25u0e2du0e07', u' 5%'] ถ้า print ดีหน่อยๆ มันก้ประมาณว่า ทดลอง&#124;ทดลอง&#124; 5%.ก่อนจะใช้ได้ก็ลง libicu ก่อนโดยใช้ aptitude install libicu-dev แล้วตามด้วย easy_install pyicu (สมมุติว่าลง easy_install กับ python ไว้อยู่แล้วนะครับ)</p>
]]></content:encoded>
</item>
<item>
<title><![CDATA[KUCut - โปรแกรมตัดคำ ที่เขียนด้วย Python]]></title>
<link>http://openil.wordpress.com/?p=101</link>
<pubDate>Wed, 20 Feb 2008 10:49:24 +0000</pubDate>
<dc:creator>वीर</dc:creator>
<guid>http://openil.wordpress.com/?p=101</guid>
<description><![CDATA[หลายคนแม้แต่ในหน่วยวิจัยเดียวกันม]]></description>
<content:encoded><![CDATA[<p>หลายคนแม้แต่ในหน่วยวิจัยเดียวกันมักจะถามผมว่าใช้โปรแกรมตัดคำตัวไหนอยู่. โปรแกรมตัดคำตัวที่ผมใช้เป็นหลักชื่อว่า KUCut จาก <a href="http://naist.cpe.ku.ac.th/">NAiST @KU</a>มี license แบบ GPL และ download ได้จาก <a href="http://naist.cpe.ku.ac.th/pkg/kucut-1.2.2_python25_fix.zip">http://naist.cpe.ku.ac.th/pkg/kucut-1.2.2_python25_fix.zip</a>. โปรแกรมตัดคำตัวนี้เขียนด้วยภาษา Python. หลักการที่แปลกจากตัวอื่นคือใช้เทคนิค unsupervised machine learning ด้วย อ่านเพิ่มได้จาก <a href="http://naist.cpe.ku.ac.th/downloads/publications/2003/Thai_Word_Segmentation_based_on_Global_and_Local_Unsupervised_Learning.pdf">"การตัดคําภาษาไทยดวยเทคนิคการเรียนรูแบบไมใชตัวอยาง"</a>.</p>
<p>ส่วน Python sdk และ runtime (ภาษาเรียกแบบ Java :-P) สามารถ download ได้จาก  <a href="http://www.python.org/download/">http://www.python.org/download/</a></p>
]]></content:encoded>
</item>

</channel>
</rss>
