开发者

Python - Library that compute relevance score for text search

My idea is to achieve an execution similar to the MySQL MATCH / AGAINST keywords.

Do you know a python 开发者_如何学JAVAlibrary that compute relevance score for text searches?

If not satisfying answers I am going to use a Python connector to MySQL.


Have a look at PyLucene http://lucene.apache.org/pylucene/

import os, sys, unittest, lucene
lucene.initVM()

baseDir = os.path.dirname(os.path.abspath(sys.argv[0]))
sys.path.append(baseDir)

import lia.searching.ScoreTest
from lucene import System

System.setProperty("index.dir", os.path.join(baseDir, 'index'))
unittest.main(lia.searching.ScoreTest)

You can found more examples and lia at http://svn.apache.org/viewvc/lucene/pylucene/trunk/samples/LuceneInAction/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜