Commit 084bafb3 authored by Fred Drake's avatar Fred Drake

_search_wids(): Move the import of okascore out of the function so

    so the import machinery is not invoked on each call.
parent de770c57
...@@ -23,6 +23,7 @@ from Products.ZCTextIndex.IIndex import IIndex ...@@ -23,6 +23,7 @@ from Products.ZCTextIndex.IIndex import IIndex
from Products.ZCTextIndex.BaseIndex import BaseIndex, \ from Products.ZCTextIndex.BaseIndex import BaseIndex, \
inverse_doc_frequency, \ inverse_doc_frequency, \
scaled_int scaled_int
from Products.ZCTextIndex.okascore import score
class OkapiIndex(BaseIndex): class OkapiIndex(BaseIndex):
...@@ -117,7 +118,6 @@ class OkapiIndex(BaseIndex): ...@@ -117,7 +118,6 @@ class OkapiIndex(BaseIndex):
# Cautions: okascore hardcodes the values of K, B1, and the scaled_int # Cautions: okascore hardcodes the values of K, B1, and the scaled_int
# function. # function.
def _search_wids(self, wids): def _search_wids(self, wids):
from Products.ZCTextIndex.okascore import score
if not wids: if not wids:
return [] return []
N = float(len(self._docweight)) # total # of docs N = float(len(self._docweight)) # total # of docs
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment