本文整理匯總了Python中PyLucene.initVM方法的典型用法代碼示例。如果您正苦於以下問題:Python PyLucene.initVM方法的具體用法?Python PyLucene.initVM怎麽用?Python PyLucene.initVM使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類PyLucene
的用法示例。
在下文中一共展示了PyLucene.initVM方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: package
# 需要導入模塊: import PyLucene [as 別名]
# 或者: from PyLucene import initVM [as 別名]
import re
import os
import time
import logging
# try to import the PyLucene package (with the two possible names)
# remember the type of the detected package (compiled with jcc (>=v2.3) or
# with gcj (<=v2.2)
try:
import PyLucene
_COMPILER = 'gcj'
except ImportError:
# if this fails, then there is no pylucene installed
import lucene
PyLucene = lucene
PyLucene.initVM(PyLucene.CLASSPATH)
_COMPILER = 'jcc'
import CommonIndexer
UNNAMED_FIELD_NAME = "FieldWithoutAName"
MAX_FIELD_SIZE = 1048576
def is_available():
return _get_pylucene_version() == 2
class PyLuceneDatabase(CommonIndexer.CommonDatabase):
"""manage and use a pylucene indexing database"""