- 浏览: 380149 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (215)
- ubuntu (27)
- 虚拟机 (13)
- 数据库 (29)
- JAVA (40)
- 搜索 (23)
- 开发工具 (2)
- 产品 (2)
- 工具 (1)
- 应用服务器 (5)
- linux (17)
- log (1)
- 多线程 (3)
- 异常 (1)
- shell (6)
- 12306 ;互联网 (1)
- 持续集成&Hudson (4)
- js (1)
- JAVA OR-Map (1)
- 漏洞 (1)
- svn (1)
- MAVEN (3)
- 架构 (1)
- windows (1)
- json (1)
- web (3)
- jenkins (2)
- iptables (2)
- JAVA ssh (0)
- 项目管理 (1)
- tomcat (1)
- 安全 (1)
- 数据库 mysql (1)
- 性能 (1)
最新评论
-
sbwfgihc:
怎么用的啊,
<转>mysql 树查询语句 -
panghaoyu:
实现一个智能提示功能需要ajax、数据库、jsp/php、算法 ...
<转>Solr Suggest实现搜索智能提示 -
songsove:
请问您qq多少
solr 对拼音搜索和拼音首字母搜索的支持 -
panghaoyu:
实现一个智能提示功能需要ajax、数据库、jsp/php、算法 ...
<转>Solr Suggest实现搜索智能提示 -
norain1988:
这样就可以实现相关搜索了吗
solr 百度相关搜索类似功能的实现
原链接: http://hi.baidu.com/stone_kings/item/fff2efd6db55df2b38f6f766
发现很久很久没更新了,尤其是这个模块,也就好久没进步了!学习如逆水行舟,不进则退!趁着还没到白首之际,应该多学习。
首先,还是先贴出来参考来源,毕竟非原创。
(1)、http://blog.csdn.net/askpp/archive/2009/09/08/4532355.aspx
(2)、http://qipei.javaeye.com/blog/365207
现在继续:
1、到http://code.google.com/p/paoding/downloads/list下载paoding-analysis-2.0.4-alpha2.zip
2、然后解压缩,找到dic文件夹,复制到你想存放的文件夹下
<!--[if gte vml 1]><v:shapetype id="_x0000_t75" coordsize="21600,21600"
o:spt="75" o:preferrelative="t" path="m@4@5l@4@11@9@11@9@5xe" filled="f"
stroked="f">
<v:stroke joinstyle="miter" />
<v:formulas>
<v:f eqn="if lineDrawn pixelLineWidth 0" />
<v:f eqn="sum @0 1 0" />
<v:f eqn="sum 0 0 @1" />
<v:f eqn="prod @2 1 2" />
<v:f eqn="prod @3 21600 pixelWidth" />
<v:f eqn="prod @3 21600 pixelHeight" />
<v:f eqn="sum @0 0 1" />
<v:f eqn="prod @6 1 2" />
<v:f eqn="prod @7 21600 pixelWidth" />
<v:f eqn="sum @8 21600 0" />
<v:f eqn="prod @7 21600 pixelHeight" />
<v:f eqn="sum @10 21600 0" />
</v:formulas>
<v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect" />
<o:lock v:ext="edit" aspectratio="t" />
</v:shapetype><v:shape id="图片_x0020_2" o:spid="_x0000_i1037" type="#_x0000_t75"
alt="http://hiphotos.baidu.com/xwx520/pic/item/fbf41423c208de7c9922ed1b.jpg"
style='width:399pt;height:178.5pt;visibility:visible;mso-wrap-style:square'>
<v:imagedata src="file:///r:\Temp\msohtmlclip1\01\clip_image001.png" o:title="fbf41423c208de7c9922ed1b" />
</v:shape><![endif]--><!--[if !vml]--><!--[endif]--><!--[if gte vml 1]><v:shape id="图片_x0020_3"
o:spid="_x0000_i1036" type="#_x0000_t75" alt="http://hiphotos.baidu.com/xwx520/pic/item/b5564f95a57a4d267bf480e5.jpg"
style='width:568.5pt;height:421.5pt;visibility:visible;mso-wrap-style:square'>
<v:imagedata src="file:///r:\Temp\msohtmlclip1\01\clip_image003.png" o:title="b5564f95a57a4d267bf480e5" />
</v:shape><![endif]--><!--[if !vml]--><!--[endif]-->
3、配置环境变量,如果不配置,运行会报错,报错的中文信息也是需要进行配置环境变量
<!--[if gte vml 1]><v:shape id="图片_x0020_4"
o:spid="_x0000_i1035" type="#_x0000_t75" alt="http://hiphotos.baidu.com/xwx520/pic/item/e1d7bb50d86e89721038c2a0.jpg"
style='width:315.75pt;height:371.25pt;visibility:visible;mso-wrap-style:square'>
<v:imagedata src="file:///r:\Temp\msohtmlclip1\01\clip_image005.png" o:title="e1d7bb50d86e89721038c2a0" />
</v:shape><![endif]--><!--[if !vml]--><!--[endif]-->
4、删除.compiled文件
<!--[if gte vml 1]><v:shape id="图片_x0020_5"
o:spid="_x0000_i1034" type="#_x0000_t75" alt="http://hiphotos.baidu.com/xwx520/pic/item/4c5a624e6044dae4d1c86abe.jpg"
style='width:97.5pt;height:59.25pt;visibility:visible;mso-wrap-style:square'>
<v:imagedata src="file:///r:\Temp\msohtmlclip1\01\clip_image007.png" o:title="4c5a624e6044dae4d1c86abe" />
</v:shape><![endif]--><!--[if !vml]--><!--[endif]-->5、新建一个文本文件,后缀名问.dic,采用utf-8保存到dic的文件目录中,这里保存在了E:\paodingTest\dic\locale中
<!--[if gte vml 1]><v:shape
id="图片_x0020_6" o:spid="_x0000_i1033" type="#_x0000_t75" alt="http://hiphotos.baidu.com/xwx520/pic/item/7bbc5afaee6569b959ee90bc.jpg"
style='width:568.5pt;height:471pt;visibility:visible;mso-wrap-style:square'>
<v:imagedata src="file:///r:\Temp\msohtmlclip1\01\clip_image009.png" o:title="7bbc5afaee6569b959ee90bc" />
</v:shape><![endif]--><!--[if !vml]--><!--[endif]-->
6、下面我们写个分词测试程序
<!--[if gte vml 1]><v:shape id="图片_x0020_7"
o:spid="_x0000_i1032" type="#_x0000_t75" alt="http://hiphotos.baidu.com/xwx520/pic/item/8c7c43df1e87c53d6327988f.jpg"
style='width:568.5pt;height:311.25pt;visibility:visible;mso-wrap-style:square'>
<v:imagedata src="file:///r:\Temp\msohtmlclip1\01\clip_image011.jpg" o:title="8c7c43df1e87c53d6327988f" />
</v:shape><![endif]--><!--[if !vml]--><!--[endif]-->7、自定义词库的情况下分词结果,首先看到的是词库的编译信息
<!--[if gte vml 1]><v:shape id="图片_x0020_8"
o:spid="_x0000_i1031" type="#_x0000_t75" alt="http://hiphotos.baidu.com/xwx520/pic/item/0a089ebf54f7cf2419d81f91.jpg"
style='width:568.5pt;height:195pt;visibility:visible;mso-wrap-style:square'>
<v:imagedata src="file:///r:\Temp\msohtmlclip1\01\clip_image013.png" o:title="0a089ebf54f7cf2419d81f91" />
</v:shape><![endif]--><!--[if !vml]--><!--[endif]-->
8、带自定义词库的分词结果
<!--[if gte vml 1]><v:shape id="图片_x0020_9"
o:spid="_x0000_i1030" type="#_x0000_t75" alt="http://hiphotos.baidu.com/xwx520/pic/item/0bf25ef431d584c17609d793.jpg"
style='width:354pt;height:577.5pt;visibility:visible;mso-wrap-style:square'>
<v:imagedata src="file:///r:\Temp\msohtmlclip1\01\clip_image015.png" o:title="0bf25ef431d584c17609d793" />
</v:shape><![endif]--><!--[if !vml]--><!--[endif]-->
9、删除自定义词库和.compiled文件,重新分词
<!--[if gte vml 1]><v:shape id="图片_x0020_10" o:spid="_x0000_i1029"
type="#_x0000_t75" alt="http://hiphotos.baidu.com/xwx520/pic/item/6b01aa191c987954dbb4bd64.jpg"
href="http://hiphotos.baidu.com/xwx520/pic/item/7f5f19fb7a6de44a034f569b.jpg"
target="_blank" style='width:295.5pt;height:494.25pt;visibility:visible;
mso-wrap-style:square' o:button="t">
<v:imagedata src="file:///r:\Temp\msohtmlclip1\01\clip_image017.png" o:title="6b01aa191c987954dbb4bd64" />
</v:shape><![endif]--><!--[if !vml]--><!--[endif]-->
10、放在一起比较,效果还是有的
<!--[if gte vml 1]><v:shape id="图片_x0020_11"
o:spid="_x0000_i1028" type="#_x0000_t75" alt="http://hiphotos.baidu.com/xwx520/pic/item/72bcd813dabe2dfef6039e7d.jpg"
style='width:569.25pt;height:504.75pt;visibility:visible;mso-wrap-style:square'>
<v:imagedata src="file:///r:\Temp\msohtmlclip1\01\clip_image019.png" o:title="72bcd813dabe2dfef6039e7d" />
</v:shape><![endif]--><!--[if !vml]--><!--[endif]-->
11、假设我们在分词的时候,需要把运、动分开,默认情况下是不分开的
<!--[if gte vml 1]><v:shape id="图片_x0020_12"
o:spid="_x0000_i1027" type="#_x0000_t75" alt="http://hiphotos.baidu.com/xwx520/pic/item/fe4fc7ca9669e8a8c8176844.jpg"
style='width:511.5pt;height:428.25pt;visibility:visible;mso-wrap-style:square'>
<v:imagedata src="file:///r:\Temp\msohtmlclip1\01\clip_image021.png" o:title="fe4fc7ca9669e8a8c8176844" />
</v:shape><![endif]--><!--[if !vml]--><!--[endif]-->
12、在词库中增加两个词运和动
<!--[if gte vml 1]><v:shape id="图片_x0020_13"
o:spid="_x0000_i1026" type="#_x0000_t75" alt="http://hiphotos.baidu.com/xwx520/pic/item/d105e1196167f86b42a9ad47.jpg"
style='width:568.5pt;height:453.75pt;visibility:visible;mso-wrap-style:square'>
<v:imagedata src="file:///r:\Temp\msohtmlclip1\01\clip_image023.png" o:title="d105e1196167f86b42a9ad47" />
</v:shape><![endif]--><!--[if !vml]--><!--[endif]-->
13、当然,如果想把这个分词器用得更好,还需要深入去了解和思考该分词方法,比如,“我是运动员”,虽然我们在自定义词库中填加了词“运动员”,但是依旧没有切分成“我”,“是”,“运动员”,反而出现了不相关的”动员“这个词语。而需要同时将”运动“切分为“运”,“动“,”运动“,那也是需要好好思考用法,当然这也和中国汉语的特殊性有关,例如:“乒乓球拍卖完了”,在没有上下文的情况下本身就存在歧义。
<!--[if gte vml 1]><v:shape id="图片_x0020_14"
o:spid="_x0000_i1025" type="#_x0000_t75" alt="http://hiphotos.baidu.com/xwx520/pic/item/2349d418ada8959a4bedbc36.jpg"
style='width:559.5pt;height:7in;visibility:visible;mso-wrap-style:square'>
<v:imagedata src="file:///r:\Temp\msohtmlclip1\01\clip_image025.png" o:title="2349d418ada8959a4bedbc36" />
</v:shape><![endif]--><!--[if !vml]--><!--[endif]-->
<!--[if !supportLineBreakNewLine]-->
<!--[endif]-->
发表评论
-
百度GOOGLE的用户鼠标行为分析<转>
2012-08-29 09:37 1484转自:http://www.20ju.com/conte ... -
lucene 一些性能调优建议
2012-08-22 16:12 5533lucene 排序 Lucene默认按照相关度 ... -
庖丁(Paoding)分词的词典原理解析
2012-07-03 10:14 3635Paoding分词过程中词典 ... -
solr 百度相关搜索类似功能的实现
2012-06-27 16:26 5736这个功能的实现有几种不同的思路。 大概半个月前,我在网 ... -
solr 索引库同步数据库
2012-06-27 14:01 5618对于拼音和拼音首字母的支持,当你在搜商品的时候,如果想输 ... -
solr 对拼音搜索和拼音首字母搜索的支持
2012-06-27 13:52 9049对于拼音和拼音首字母的支持,当你在搜商品的时候,如果想输 ... -
<转>Solr Suggest实现搜索智能提示
2012-06-27 10:15 13839智能提示简介 搜索的智能提示目前是各大搜索的标配应用, ... -
IK的整个分词处理过程
2012-06-26 14:25 11552IK的整个分词处理过 ... -
Solr的检索运算符
2012-06-21 14:47 4212“:” 指定字段查指定值,如返回所有值*:*² “?” 表示 ... -
Solr 学习(5) —- Solr查询语法和参数
2012-06-21 14:25 11172、查询语法 solr的一些查询语法 ... -
Apache Solr schema.xml及solrconfig.xml文件中文注解
2012-06-21 10:55 1160一、字段配置(schema)schema.xml位于so ... -
<转>LUCENE3.0 自学吧 4 TermDocs
2012-06-07 22:13 1205利用TermDocs也是可以得到一些有用的结果。。。代码 ... -
<转>Lucene里经常被聊到的几个话题
2012-06-07 21:54 1232lvpei.cnblogs.com.自己总结的Lucen ... -
<转>浅谈文档索引普遍原理<笔记>
2012-06-07 21:49 998--lvpei.cnblogs.com 搜索引擎普遍采 ... -
Lucene中Field类很重要
2012-06-07 21:46 8222org.apache.lucene.demo.Index ... -
Lucene架构简单分析
2012-06-06 15:30 1634Lucene简介Lucene 是一个基 ... -
<转>lucene3.0中Field.Index, Field.Store,Field.TermVector详解
2012-06-06 14:49 890lucene在doc.add(new Field(&quo ... -
<转>用于Lucene的各中文分词比较
2012-06-05 09:58 5554对几种中文分析器,从分词准确性和效率两方面进行比较。分析器依次 ... -
Lucene3参考资料
2012-06-05 09:46 963http://wenku.baidu.com/view/706 ... -
lucene索引word/pdf/html/txt文件及检索(搜索引擎)
2012-06-04 14:59 958因为lucene索引的时候是 ...
相关推荐
庖丁解牛分词之自定义词库、庖丁解牛配置,java搜索分词
由于庖丁官方目前提供可下载尚不支持Lucene 3.0以上版本。因此作者对paoding进行重新编译,使其与最新Lucene 3.0.1版本适用。 Latest paoding 3.0.1 for lucene 3.0.1 使用说明: 先下载2.0.4的版本(h t t p : / ...
庖丁解牛分词器源码,包含源码与对应项目,可以用eclipse打开编译
庖丁解牛分词 java包庖丁解牛分词 java包庖丁解牛分词 java包庖丁解牛分词 java包庖丁解牛分词 java包庖丁解牛分词 java包庖丁解牛分词 java包
支持中文的庖丁解牛,庖丁分词,找了好久才找到的希望对你有帮助。
Linux驱动开发庖丁解牛系类 Linux驱动开发庖丁解牛系类 Linux驱动开发庖丁解牛系类 Linux驱动开发庖丁解牛系类 Linux驱动开发庖丁解牛系类
Paoding's Knives 中文分词具有极 高效率 和 高扩展性 。引入隐喻,采用完全的面向对象设计,构思先进。 高效率:在PIII 1G内存个人机器上,1秒 可准确分词 100万 汉字。 采用基于 不限制个数 的词典文件对文章...
庖丁解牛(很好的分词效率) 在做站内全文检索时创建索引时比较快,而且感觉效果比JE要好一些。。
可以适用于lucene3.5的庖丁解牛分词器jar包
【民生商社】“庖丁解牛”拆析招股书:名创优品.pdf【民生商社】“庖丁解牛”拆析招股书:名创优品.pdf【民生商社】“庖丁解牛”拆析招股书:名创优品.pdf【民生商社】“庖丁解牛”拆析招股书:名创优品.pdf【民生...
庖丁解牛分词时需要的高亮显示jar包,高亮显示需要的jar包
庖丁解牛中文分词器,可以完美整合,只要配置好字典的路径,就可以使用庖丁解牛,可以有效针对中文进行分词,而且可以自定义词典。
支持lucene3的庖丁解牛分词器和字典,可直接调用
经典的庖丁解牛通达信主图指标通达信指标公式源码.doc
中文分词 庖丁解牛 2_0_0版本发布 - 企业应用 中文分词 庖丁解牛 2_0_0版本发布 - 企业应用
侯捷 STL剖析PDF格式版本,开发者的宝典
庖丁解牛,Lucene分词器,很难得的资源。
庖丁解牛—纵向切入ASP.NET3.5控件和组件开发技术 pdf,word
庖丁解牛详细demo
Version 2.0.4–alpha2 通过 analyzer.bat 程序,可以输入中文文本,即时地查看分词效果。 Jar包在lib 文件夹中。 本人倡导零分资源共享,欢迎大家下载和评论。