Google Groups Home
Help | Sign in
Spring Context下使用"庖丁解牛"
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
Qieqie  
View profile
 More options Aug 8 2007, 10:06 pm
From: Qieqie <qieqie.w...@gmail.com>
Date: Thu, 09 Aug 2007 02:06:18 -0000
Local: Wed, Aug 8 2007 10:06 pm
Subject: [指南] Spring Context下使用"庖丁解牛"
Spring Context下使用"庖丁解牛":

1)paoding-analysis.properties配置文件放到classpath下,注意要在该文件中配置好词典安装目录
2)在原来的ApplicationContext-xxx.xml文件中,或新创建一个ApplicationContext-xxx.xml文件中
包含以下三个bean的配置

    <bean id="writerAnalyzer"
class="net.paoding.analysis.analyzer.PaodingAnalyzer">
        <property name="knife" ref="paoding"/>
        <property name="mode" value="1"/>
    </bean>

    <bean id="queryAnalyzer"
class="net.paoding.analysis.analyzer.PaodingAnalyzer">
        <property name="knife" ref="paoding"/>
        <property name="mode" value="2"/>
    </bean>

    <bean id="paoding"
class="net.paoding.analysis.knife.PaodingMaker"  factory-method="make"/


3) 建立索引时,使用writerAnalyzer (尽量多切词语);检索时可以使用queryAnalyzer(最大切词)

注1:paoding bean的配置方法可以更加灵活,不过仅当上面这种简单方法满足不了时,再去深入探寻。

注2:writerAnalyzer和queryAnalyzer现在mode是一个整型数,这在配置上不是很易读,2.0.0版本只能如此,但之后的
版本可以除了直接配置整型数,还可以这样设置: <property name="mode" value="writer"/>、
<property name="mode" value="query"/>


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Qieqie  
View profile
 More options Aug 8 2007, 10:12 pm
From: Qieqie <qieqie.w...@gmail.com>
Date: Wed, 08 Aug 2007 19:12:18 -0700
Local: Wed, Aug 8 2007 10:12 pm
Subject: Re: Spring Context下使用"庖丁解牛"
帖子中的xml看起来不是很整齐, 大家可以参考JavaEye上的"镜像":

http://analysis.group.javaeye.com/group/post/15584

On Aug 9, 10:06 am, Qieqie <qieqie.w...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google