庖丁 Lucene 3.0 升级

209 views
Skip to first unread message

Qieqie

unread,
Jan 20, 2010, 10:02:48 PM1/20/10
to Paoding's Knives, reno...@gmail.com
*庖丁 Lucene 3.0 升级说明*

(代码已提交svn,下载包稍后稍推迟下)

这次升级的主要目的是支持Lucene 3.0,具体改动如下:

(1)支持Lucene 3.0,对Lucene 3.0以下的版本,请使用 http://paoding.googlecode.com/svn/branches/paoding-for-lucene-2.4/
中的代码编译。

(2)使用Java 5.0编译,不再支持Java 1.4,以后的新功能将会在Java 5上开发。

(3)PaodingAnalyzer的调用接口没有改动,但在使用上需要适应Lucene 3.0的API,分词示例如下:

//生成analyzer实例
Analyzer analyzer = new PaodingAnalyzer(properties);

//取得Token流
TokenStream stream = analyzer.tokenStream("", reader);

//重置到流的开始位置
stream.reset();

//添加工具类
TermAttribute termAtt = (TermAttribute) stream.addAttribute
(TermAttribute.class);
OffsetAttribute offAtt = (OffsetAttribute) stream.addAttribute
(OffsetAttribute.class);

//循环打印所有分词及其位置
while (stream.incrementToken()) {
System.out.println(termAtt.term() + " " +
offAtt.startOffset() + " " + offAtt.endOffset());
}
具体使用方法可以参见net.paoding.analysis.analyzer.estimate以及
net.paoding.analysis.examples包下面的示例代码。


by reno...@gmail.com

nid.hust

unread,
Jan 20, 2010, 10:19:44 PM1/20/10
to Paoding's Knives, reno.gan
楼主辛苦了,赞!
 

nid.hust
2010-01-21

发件人: Qieqie
发送时间: 2010-01-21 11:02:50
收件人: Paoding's Knives
抄送: reno.gan
主题: 庖丁 Lucene 3.0 升级
 
by reno...@gmail.com-- 
您收到此邮件是因为您订阅了 Google 网上论坛的“Paoding's Knives”论坛。
要向此网上论坛发帖,请发送电子邮件至 pao...@googlegroups.com
要取消订阅此网上论坛,请发送电子邮件至 paoding+u...@googlegroups.com
若有更多问题,请通过 http://groups.google.com/group/paoding?hl=zh-CN 访问此网上论坛。

Rory Ye

unread,
Jan 24, 2010, 8:20:09 PM1/24/10
to pao...@googlegroups.com
赞。还没提供最新的下载包?


2010/1/21 nid.hust <nid....@gmail.com>
--
您收到此邮件是因为您订阅了 Google 网上论坛的“Paoding's Knives”论坛。
要向此网上论坛发帖,请发送电子邮件至 pao...@googlegroups.com
要取消订阅此网上论坛,请发送电子邮件至 paoding+u...@googlegroups.com
若有更多问题,请通过 http://groups.google.com/group/paoding?hl=zh-CN 访问此网上论坛。




--
My site:http://www.jdkcn.com
Twitter: @jdkcn

Qieqie

unread,
Jan 24, 2010, 10:33:27 PM1/24/10
to pao...@googlegroups.com, pao...@googlegroups.com
请稍等两天,此期间建议走下svn

王志亮
人人网 架构部 
电话:186 000 70867

在 2010-1-25,9:20,Rory Ye <ror...@gmail.com> 写到:

Rory Ye

unread,
Jan 24, 2010, 11:36:11 PM1/24/10
to pao...@googlegroups.com
已经checkout. 感谢楼主的努力。

2010/1/25 Qieqie <qieqi...@gmail.com>
Reply all
Reply to author
Forward
0 new messages