<?xml version="1.0" encoding="UTF-8"?>
<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/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>互联网，请记住我 &#187; 中文分词</title>
	<atom:link href="http://www.162cm.com/archives/tag/%e4%b8%ad%e6%96%87%e5%88%86%e8%af%8d/feed" rel="self" type="application/rss+xml" />
	<link>http://www.162cm.com</link>
	<description>一米六二，绝不转载</description>
	<lastBuildDate>Fri, 03 Sep 2010 15:30:30 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>社区全文检索引擎Hyper Estraier 学习笔记[3]</title>
		<link>http://www.162cm.com/archives/658.html</link>
		<comments>http://www.162cm.com/archives/658.html#comments</comments>
		<pubDate>Sun, 22 Jun 2008 04:26:13 +0000</pubDate>
		<dc:creator>一米六二</dc:creator>
				<category><![CDATA[未分类]]></category>
		<category><![CDATA[HyperEstraier]]></category>
		<category><![CDATA[中文分词]]></category>
		<category><![CDATA[搜索引擎]]></category>
		<category><![CDATA[检索]]></category>

		<guid isPermaLink="false">http://www.162cm.com/?p=658</guid>
		<description><![CDATA[经过摸索，我决定给HyperEstraier加上由Hightman写的scws支持，使之支持中文分词。 实地看了代码之后，发现Hyperestraier的结构划分并不好，这可能决定了他只能是某些Hacker的心血之作，而不适用多人协作开发，大规模推广应用。这是旁话。 既然找到分词默认是使用的estraier.c的est_break_text函数，那我的目标就是改造这个函数,现在这个函数被我改成了: scws_t seg; /* Break a sentence of text and extract words. */ void est_break_text(const char *text, CBLIST *list, int norm, int tail){ // hack by renlu.xu &#160; CBLIST *words; &#160; const unsigned char *word, *next; &#160; unsigned &#8230; <a href="http://www.162cm.com/archives/658.html">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
		<wfw:commentRss>http://www.162cm.com/archives/658.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>文本挖掘,构造垃圾站[一]</title>
		<link>http://www.162cm.com/archives/629.html</link>
		<comments>http://www.162cm.com/archives/629.html#comments</comments>
		<pubDate>Thu, 01 May 2008 09:31:25 +0000</pubDate>
		<dc:creator>一米六二</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ror]]></category>
		<category><![CDATA[RSS]]></category>
		<category><![CDATA[中文分词]]></category>
		<category><![CDATA[自然语言处理]]></category>

		<guid isPermaLink="false">http://www.162cm.com/?p=629</guid>
		<description><![CDATA[最近为ruby,ruby on rails的灵活和魔幻而着迷。爽。 上上周一个同事给我们介绍了自然语言处理的一些知识，觉得很不错。事实上虽然是雅虎公司的一名工程师，但是因为我不是搜索／邮箱／平台研发这些部门，基本上没有接触到比较深一点的东西，也许对于这些部门来说很简单的东西，对于我来说还是很难以理解的。 课后自己去找了些东西看了看，然后有这样一思路,可以用来构造一个垃圾站。 基本思路是: 1.首先我需要一个spider.这个spider由两个部分完成，第一部分是由一个feed管理程序来不停地从网上读rss回来，第二部分是常规spider，跟nutch什么的spider无异. 2.第二部分是预处理。这一部分包括：纯文本化、去垃圾。 3.第三部分是运算:分词，关键词提取,提取相关文章。 4.热点呈现,网站部分。 具体实现: rss 的spider要简单一些,但是根据抓回来的内容，也是很多质量不高的种子。比如新浪新闻的rss基本没有正文,而有些feedsky的种子后面跟着一个小尾巴(广告),需要处理。 对于没有正文的，很简单,将之平均长度算出来，如果某个种子的平均长度都很短，就将这个种子丢弃。 对于很多内容不咱的，但是广告链接一大堆的，也有办法:先纯文本化,一个文档就细化为一系列的段。html标签有的去掉了，有的换成空格了.这时将段按空格分组，如果没组长度都很短,即文章内容中若是大量充满着html标签，这样的多半是广告或是垃圾链接。 比如这一段: 2006-09-11&#160; &#160;charon 写道&#160; 我现在对这类动态语言的非本质实现抱很大的怀疑态度。 最近除了这个新闻以外，IronPyton(python的.net版本)1.0也发布了。但看了一下，感觉虽然不是特别差，也是差得可以。也许这是给那些熟悉.net同时又想找一个动态语言的人一个选择？ 两个语法相同但是标准库有差异(jruby可能语法上也略有差异)，支持库有重大差异的语言，还能算是一个语言吗？ 当年不论出于什么原因，Sun对于MS污染java的行为举起了大棒，现在这几个开源社区的动态语言，却纷纷搞出这么些方言来，不好说阿。&#160; &#160;IronPython和JRuby可能还是不太一样的。dotnet平台实际上提供了自己统一的dotnet fraemwork类库，所谓不同的编程语言支持，更像是一种语法糖衣而已。但是JRuby其实实现了大部分ruby自己的库，用JRuby并非仅仅用一个ruby语法而已，关键是ruby本身的方便的库和rails框架，至于Java库的支持，只是辅助了。&#160; Sun对JRuby的支持表明了一种态度，这种态度是承认ruby在企业快速开发方面的优势，而对ruby提供更好的支持。而Microsoft支持的IronPython更像是用python语法写C#程序那种感觉，换汤不换药。&#160; &#160; &#160;charon &#160;&#160; &#160; &#160; &#160; &#160; &#160; &#160; &#160; robbin&#160; &#160; &#160;浏览: 1653543 &#8230; <a href="http://www.162cm.com/archives/629.html">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
		<wfw:commentRss>http://www.162cm.com/archives/629.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>150行代码,搞定中文分词</title>
		<link>http://www.162cm.com/archives/411.html</link>
		<comments>http://www.162cm.com/archives/411.html#comments</comments>
		<pubDate>Sat, 16 Jun 2007 15:50:01 +0000</pubDate>
		<dc:creator>一米六二</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[未分类]]></category>
		<category><![CDATA[中文]]></category>
		<category><![CDATA[中文分词]]></category>
		<category><![CDATA[自然语言]]></category>
		<category><![CDATA[自然语言处理]]></category>

		<guid isPermaLink="false">http://www.162cm.com/archives/411.html</guid>
		<description><![CDATA[中文分词一直是一个看起来似乎比较神秘的东西。记得java中的lucene好像自带了两个分词器。一个是按汉字分，就是一个字分成一个词。比如&#8221;我要到饭馆吃饭“，就被分成”我/要/到/饭/馆/吃/饭&#8221;.别一个是相邻的两个字分成一个词，分出来的结果是&#8221;我要/要到/到饭/饭馆/馆吃/吃饭&#8221;.然而这两种虽说在做搜索时建索引什么的操作时也是相当有用的，但是毕竟是一种权宜之计，咱不能一直停留在这个水平上。 下面是来自Rlucene的一段示例代码，154行，利用sogou的词库搞定了中文分词。代码如下: #! /usr/bin/ruby require &#8220;socket&#8221; #通过网络得到分词结果 def segChinese_net(line) @conn=TCPSocket.open(&#8220;localhost&#8221;,1099) @conn.write(line) line=@conn.read return line.split(&#8221; &#8220;) end @f= open(&#8220;dict/sogou.txt&#8221;) @datas=@f.read.split(&#8220;\n&#8221;) @f.close @f2=open(&#8220;dict/firstword.txt&#8221;) @firstwords=@f2.read.split(&#8220;\n&#8221;) @f2.close @maintable=Hash.new() @firstwords.each{&#124;x&#124; @maintable[x]=[x] } @datas.each{&#124;x&#124; @maintable[x[0].chr+x[1].chr+x[2].chr].push(x) } def segChinese(line) temp=0 max=(line.length/3) words=[] while(temp pos=temp*3 str1=line[pos].chr+line[pos+1].chr+line[pos+2].chr str12=str1 str1234=str1 &#8230; <a href="http://www.162cm.com/archives/411.html">继续阅读 <span class="meta-nav">&#8594;</span></a>]]></description>
		<wfw:commentRss>http://www.162cm.com/archives/411.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic page generated in 0.407 seconds. -->
<!-- Cached page generated by WP-Super-Cache on 2010-09-08 14:17:28 -->
