<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
	
	>
<channel>
	<title>
	「纯python的全文搜索组件Whoosh」的评论	</title>
	<atom:link href="https://haoluobo.com/2010/01/%e7%ba%afpython%e7%9a%84%e5%85%a8%e6%96%87%e6%90%9c%e7%b4%a2%e7%bb%84%e4%bb%b6whoosh/feed/" rel="self" type="application/rss+xml" />
	<link>https://haoluobo.com/2010/01/%e7%ba%afpython%e7%9a%84%e5%85%a8%e6%96%87%e6%90%9c%e7%b4%a2%e7%bb%84%e4%bb%b6whoosh/</link>
	<description>to be continue....</description>
	<lastBuildDate>Wed, 17 Oct 2012 02:40:11 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.2</generator>
	<item>
		<title>
		评论者：简单的快乐		</title>
		<link>https://haoluobo.com/2010/01/%e7%ba%afpython%e7%9a%84%e5%85%a8%e6%96%87%e6%90%9c%e7%b4%a2%e7%bb%84%e4%bb%b6whoosh/#comment-82</link>

		<dc:creator><![CDATA[简单的快乐]]></dc:creator>
		<pubDate>Wed, 17 Oct 2012 02:40:11 +0000</pubDate>
		<guid isPermaLink="false">/index.php/2010/01/%e7%ba%afpython%e7%9a%84%e5%85%a8%e6%96%87%e6%90%9c%e7%b4%a2%e7%bb%84%e4%bb%b6whoosh/#comment-82</guid>

					<description><![CDATA[其实可以用whoosh的自带的N-grams
http://packages.python.org/Whoosh/ngrams.html]]></description>
			<content:encoded><![CDATA[<p>其实可以用whoosh的自带的N-grams<br />
<a href="http://packages.python.org/Whoosh/ngrams.html" rel="nofollow ugc">http://packages.python.org/Whoosh/ngrams.html</a></p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		评论者：vicalloy		</title>
		<link>https://haoluobo.com/2010/01/%e7%ba%afpython%e7%9a%84%e5%85%a8%e6%96%87%e6%90%9c%e7%b4%a2%e7%bb%84%e4%bb%b6whoosh/#comment-81</link>

		<dc:creator><![CDATA[vicalloy]]></dc:creator>
		<pubDate>Fri, 12 Oct 2012 00:59:17 +0000</pubDate>
		<guid isPermaLink="false">/index.php/2010/01/%e7%ba%afpython%e7%9a%84%e5%85%a8%e6%96%87%e6%90%9c%e7%b4%a2%e7%bb%84%e4%bb%b6whoosh/#comment-81</guid>

					<description><![CDATA[回复给 &lt;a href=&quot;https://haoluobo.com/2010/01/%e7%ba%afpython%e7%9a%84%e5%85%a8%e6%96%87%e6%90%9c%e7%b4%a2%e7%bb%84%e4%bb%b6whoosh/#comment-80&quot;&gt;简单的快乐&lt;/a&gt;。

这样分词主要是出于使用方便的考虑，通常情况下效果还可以。如果希望得到比较高的分词质量还是得用专门的分词组件。]]></description>
			<content:encoded><![CDATA[<p>回复给 <a href="https://haoluobo.com/2010/01/%e7%ba%afpython%e7%9a%84%e5%85%a8%e6%96%87%e6%90%9c%e7%b4%a2%e7%bb%84%e4%bb%b6whoosh/#comment-80">简单的快乐</a>。</p>
<p>这样分词主要是出于使用方便的考虑，通常情况下效果还可以。如果希望得到比较高的分词质量还是得用专门的分词组件。</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		评论者：简单的快乐		</title>
		<link>https://haoluobo.com/2010/01/%e7%ba%afpython%e7%9a%84%e5%85%a8%e6%96%87%e6%90%9c%e7%b4%a2%e7%bb%84%e4%bb%b6whoosh/#comment-80</link>

		<dc:creator><![CDATA[简单的快乐]]></dc:creator>
		<pubDate>Thu, 11 Oct 2012 07:50:30 +0000</pubDate>
		<guid isPermaLink="false">/index.php/2010/01/%e7%ba%afpython%e7%9a%84%e5%85%a8%e6%96%87%e6%90%9c%e7%b4%a2%e7%bb%84%e4%bb%b6whoosh/#comment-80</guid>

					<description><![CDATA[这样的建立中文索引的话，分割成一个个的字，没有分词功能，搜索出来的结果大打折扣了]]></description>
			<content:encoded><![CDATA[<p>这样的建立中文索引的话，分割成一个个的字，没有分词功能，搜索出来的结果大打折扣了</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		评论者：python.cn(news, jobs)		</title>
		<link>https://haoluobo.com/2010/01/%e7%ba%afpython%e7%9a%84%e5%85%a8%e6%96%87%e6%90%9c%e7%b4%a2%e7%bb%84%e4%bb%b6whoosh/#comment-79</link>

		<dc:creator><![CDATA[python.cn(news, jobs)]]></dc:creator>
		<pubDate>Wed, 15 Jun 2011 09:30:59 +0000</pubDate>
		<guid isPermaLink="false">/index.php/2010/01/%e7%ba%afpython%e7%9a%84%e5%85%a8%e6%96%87%e6%90%9c%e7%b4%a2%e7%bb%84%e4%bb%b6whoosh/#comment-79</guid>

					<description><![CDATA[@vicalloy 我转发和分享给其他同学了。]]></description>
			<content:encoded><![CDATA[<p>@vicalloy 我转发和分享给其他同学了。</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		评论者：vicalloy		</title>
		<link>https://haoluobo.com/2010/01/%e7%ba%afpython%e7%9a%84%e5%85%a8%e6%96%87%e6%90%9c%e7%b4%a2%e7%bb%84%e4%bb%b6whoosh/#comment-78</link>

		<dc:creator><![CDATA[vicalloy]]></dc:creator>
		<pubDate>Mon, 05 Jul 2010 01:53:49 +0000</pubDate>
		<guid isPermaLink="false">/index.php/2010/01/%e7%ba%afpython%e7%9a%84%e5%85%a8%e6%96%87%e6%90%9c%e7%b4%a2%e7%bb%84%e4%bb%b6whoosh/#comment-78</guid>

					<description><![CDATA[回复给 &lt;a href=&quot;https://haoluobo.com/2010/01/%e7%ba%afpython%e7%9a%84%e5%85%a8%e6%96%87%e6%90%9c%e7%b4%a2%e7%bb%84%e4%bb%b6whoosh/#comment-77&quot;&gt;zjm1126&lt;/a&gt;。

我给出的则个正则表达式是按照字分词，
比如&quot;你们好&quot;会分成
你/们/好
文章中只要包含了 你/们/好 这三个字都会搜索出来（比如：“你的们都好啊”会被认为匹配）。
为了避免这个情况，你可以给要搜索的文字加个双引号。
比如 u&#039;&quot;你们好&quot;&#039;]]></description>
			<content:encoded><![CDATA[<p>回复给 <a href="https://haoluobo.com/2010/01/%e7%ba%afpython%e7%9a%84%e5%85%a8%e6%96%87%e6%90%9c%e7%b4%a2%e7%bb%84%e4%bb%b6whoosh/#comment-77">zjm1126</a>。</p>
<p>我给出的则个正则表达式是按照字分词，<br />
比如&#8221;你们好&#8221;会分成<br />
你/们/好<br />
文章中只要包含了 你/们/好 这三个字都会搜索出来（比如：“你的们都好啊”会被认为匹配）。<br />
为了避免这个情况，你可以给要搜索的文字加个双引号。<br />
比如 u'&#8221;你们好&#8221;&#8216;</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		评论者：zjm1126		</title>
		<link>https://haoluobo.com/2010/01/%e7%ba%afpython%e7%9a%84%e5%85%a8%e6%96%87%e6%90%9c%e7%b4%a2%e7%bb%84%e4%bb%b6whoosh/#comment-77</link>

		<dc:creator><![CDATA[zjm1126]]></dc:creator>
		<pubDate>Sat, 03 Jul 2010 19:15:57 +0000</pubDate>
		<guid isPermaLink="false">/index.php/2010/01/%e7%ba%afpython%e7%9a%84%e5%85%a8%e6%96%87%e6%90%9c%e7%b4%a2%e7%bb%84%e4%bb%b6whoosh/#comment-77</guid>

					<description><![CDATA[hi 博主 你好：
小弟现在也在弄whoosh，现在遇到的困难是没办法中文分词  而且whoosh给的例子查找一个中文 比如“哈”  就会出错 ,借用你的例子 提示根本没有 find 方法  总之还请仁兄帮帮忙  我的例子在这 http://omploader.org/vNHRyMg/example.rar
由于我不知道你能否给我回复 还请发邮件通知我
谢谢]]></description>
			<content:encoded><![CDATA[<p>hi 博主 你好：<br />
小弟现在也在弄whoosh，现在遇到的困难是没办法中文分词  而且whoosh给的例子查找一个中文 比如“哈”  就会出错 ,借用你的例子 提示根本没有 find 方法  总之还请仁兄帮帮忙  我的例子在这 <a href="http://omploader.org/vNHRyMg/example.rar" rel="nofollow ugc">http://omploader.org/vNHRyMg/example.rar</a><br />
由于我不知道你能否给我回复 还请发邮件通知我<br />
谢谢</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		评论者：vicalloy		</title>
		<link>https://haoluobo.com/2010/01/%e7%ba%afpython%e7%9a%84%e5%85%a8%e6%96%87%e6%90%9c%e7%b4%a2%e7%bb%84%e4%bb%b6whoosh/#comment-76</link>

		<dc:creator><![CDATA[vicalloy]]></dc:creator>
		<pubDate>Mon, 17 May 2010 12:21:57 +0000</pubDate>
		<guid isPermaLink="false">/index.php/2010/01/%e7%ba%afpython%e7%9a%84%e5%85%a8%e6%96%87%e6%90%9c%e7%b4%a2%e7%bb%84%e4%bb%b6whoosh/#comment-76</guid>

					<description><![CDATA[回复给 &lt;a href=&quot;https://haoluobo.com/2010/01/%e7%ba%afpython%e7%9a%84%e5%85%a8%e6%96%87%e6%90%9c%e7%b4%a2%e7%bb%84%e4%bb%b6whoosh/#comment-75&quot;&gt;jttqzbc&lt;/a&gt;。

Whoosh的分词是基于正则表达式的，所以只需要写出合适的正则表达式就可以正确分词。
下面是一些例子，可能有不完善的地方，需要继续完善完善。
#测试分词
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from whoosh.analysis import RegexAnalyzer
rex = RegexAnalyzer(ur&quot;([\u4e00-\u9fa5])&#124;(\w+(\.?\w+)*)&quot;)
print [token.text for token in rex(u&quot;hi 中 000 中文测试中文 there 3.141 big-time under_score&quot;)]
#一个完整的演示
#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from whoosh.index import create_in
from whoosh.fields import *
from whoosh.analysis import RegexAnalyzer
analyzer = RegexAnalyzer(ur&quot;([\u4e00-\u9fa5])&#124;(\w+(\.?\w+)*)&quot;)
schema = Schema(title=TEXT(stored=True), path=ID(stored=True), content=TEXT(stored=True, analyzer=analyzer))
ix = create_in(&quot;indexdir&quot;, schema)
writer = ix.writer()
writer.add_document(title=u&quot;First document&quot;, path=u&quot;/a&quot;,
                    content=u&quot;This is the first document we&#039;ve added!&quot;)
writer.add_document(title=u&quot;Second document&quot;, path=u&quot;/b&quot;,
                    content=u&quot;The second one 你 中文测试中文 is even more interesting!&quot;)
writer.commit()
searcher = ix.searcher()
results = searcher.find(&quot;content&quot;, u&quot;first&quot;)
print results[0]
results = searcher.find(&quot;content&quot;, u&quot;你&quot;)
print results[0]
results = searcher.find(&quot;content&quot;, u&quot;测试&quot;)
print results[0]]]></description>
			<content:encoded><![CDATA[<p>回复给 <a href="https://haoluobo.com/2010/01/%e7%ba%afpython%e7%9a%84%e5%85%a8%e6%96%87%e6%90%9c%e7%b4%a2%e7%bb%84%e4%bb%b6whoosh/#comment-75">jttqzbc</a>。</p>
<p>Whoosh的分词是基于正则表达式的，所以只需要写出合适的正则表达式就可以正确分词。<br />
下面是一些例子，可能有不完善的地方，需要继续完善完善。<br />
#测试分词<br />
#!/usr/bin/env python<br />
# -*- coding: UTF-8 -*-<br />
from whoosh.analysis import RegexAnalyzer<br />
rex = RegexAnalyzer(ur&#8221;([\u4e00-\u9fa5])|(\w+(\.?\w+)*)&#8221;)<br />
print [token.text for token in rex(u&#8221;hi 中 000 中文测试中文 there 3.141 big-time under_score&#8221;)]<br />
#一个完整的演示<br />
#!/usr/bin/env python<br />
# -*- coding: UTF-8 -*-<br />
from whoosh.index import create_in<br />
from whoosh.fields import *<br />
from whoosh.analysis import RegexAnalyzer<br />
analyzer = RegexAnalyzer(ur&#8221;([\u4e00-\u9fa5])|(\w+(\.?\w+)*)&#8221;)<br />
schema = Schema(title=TEXT(stored=True), path=ID(stored=True), content=TEXT(stored=True, analyzer=analyzer))<br />
ix = create_in(&#8220;indexdir&#8221;, schema)<br />
writer = ix.writer()<br />
writer.add_document(title=u&#8221;First document&#8221;, path=u&#8221;/a&#8221;,<br />
                    content=u&#8221;This is the first document we&#8217;ve added!&#8221;)<br />
writer.add_document(title=u&#8221;Second document&#8221;, path=u&#8221;/b&#8221;,<br />
                    content=u&#8221;The second one 你 中文测试中文 is even more interesting!&#8221;)<br />
writer.commit()<br />
searcher = ix.searcher()<br />
results = searcher.find(&#8220;content&#8221;, u&#8221;first&#8221;)<br />
print results[0]<br />
results = searcher.find(&#8220;content&#8221;, u&#8221;你&#8221;)<br />
print results[0]<br />
results = searcher.find(&#8220;content&#8221;, u&#8221;测试&#8221;)<br />
print results[0]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		评论者：jttqzbc		</title>
		<link>https://haoluobo.com/2010/01/%e7%ba%afpython%e7%9a%84%e5%85%a8%e6%96%87%e6%90%9c%e7%b4%a2%e7%bb%84%e4%bb%b6whoosh/#comment-75</link>

		<dc:creator><![CDATA[jttqzbc]]></dc:creator>
		<pubDate>Sun, 16 May 2010 05:17:00 +0000</pubDate>
		<guid isPermaLink="false">/index.php/2010/01/%e7%ba%afpython%e7%9a%84%e5%85%a8%e6%96%87%e6%90%9c%e7%b4%a2%e7%bb%84%e4%bb%b6whoosh/#comment-75</guid>

					<description><![CDATA[请问haystack+whoosh对中文的支持怎么样？
我试验了一下，对于因为这样一个一个词用空格（符号）隔开的，他是可以检索的。但是对于像中文这样一个词一个词是直接连接在一起的（比如：“心理学与生活”），那么检索“心理学”或者“生活”就无法检索到结果。请问这个东西有办法解决吗？]]></description>
			<content:encoded><![CDATA[<p>请问haystack+whoosh对中文的支持怎么样？<br />
我试验了一下，对于因为这样一个一个词用空格（符号）隔开的，他是可以检索的。但是对于像中文这样一个词一个词是直接连接在一起的（比如：“心理学与生活”），那么检索“心理学”或者“生活”就无法检索到结果。请问这个东西有办法解决吗？</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
