コード例 #1
0
ファイル: query.py プロジェクト: malstor/crawtext
	def index_doc(self, doc):
		with self.ix.writer() as writer:
			try:
				writer.add_document(title=encodeValue(doc['title']), content=encodeValue(doc['content']))
			except KeyError:
				writer.add_document(content=encodeValue(doc['content']))
		return writer
コード例 #2
0
ファイル: query.py プロジェクト: malstor/crawtext
 def index_doc(self, doc):
     with self.ix.writer() as writer:
         try:
             writer.add_document(title=encodeValue(doc['title']),
                                 content=encodeValue(doc['content']))
         except KeyError:
             writer.add_document(content=encodeValue(doc['content']))
     return writer
コード例 #3
0
 def is_relevant(self, query, directory):
     q = Query(query, directory)
     return q.match({"content": encodeValue(self.text)})
コード例 #4
0
ファイル: article.py プロジェクト: malstor/crawtext
	def is_relevant(self, query, directory):
		q = Query(query, directory)
		return q.match({"content": encodeValue(self.text)})