Commit 4153122e authored by Andreas Jung's avatar Andreas Jung

Text Index does not know anymore about the available splitters.

The splitter is now aquired from the used vocabulary.
parent 72c4ac4d
...@@ -91,7 +91,7 @@ undo information so that objects can be unindexed when the old value ...@@ -91,7 +91,7 @@ undo information so that objects can be unindexed when the old value
is no longer known. is no longer known.
""" """
__version__ = '$Revision: 1.2 $'[11:-2] __version__ = '$Revision: 1.3 $'[11:-2]
import string, re import string, re
...@@ -110,7 +110,6 @@ from BTrees.IIBTree import IIBTree, IIBucket, IISet, IITreeSet ...@@ -110,7 +110,6 @@ from BTrees.IIBTree import IIBTree, IIBucket, IISet, IITreeSet
from BTrees.IIBTree import difference, weightedIntersection from BTrees.IIBTree import difference, weightedIntersection
from Lexicon import Lexicon from Lexicon import Lexicon
import Splitter
from types import * from types import *
...@@ -174,10 +173,6 @@ class TextIndex(PluggableIndex.PluggableIndex, Persistent, ...@@ -174,10 +173,6 @@ class TextIndex(PluggableIndex.PluggableIndex, Persistent,
self.call_methods = call_methods self.call_methods = call_methods
# Default Splitter
self.availableSplitters = Splitter.availableSplitters
self.useSplitter = self.availableSplitters[0][0]
# Default text index operator (should be visible to ZMI) # Default text index operator (should be visible to ZMI)
self.operators = { 'andnot':AndNot, 'and':And, self.operators = { 'andnot':AndNot, 'and':And,
'near':Near, 'or':Or } 'near':Near, 'or':Or }
...@@ -352,7 +347,7 @@ class TextIndex(PluggableIndex.PluggableIndex, Persistent, ...@@ -352,7 +347,7 @@ class TextIndex(PluggableIndex.PluggableIndex, Persistent,
return 0 return 0
lexicon = self.getLexicon() lexicon = self.getLexicon()
splitter = Splitter.getSplitter(self.useSplitter) splitter = lexicon.Splitter
wordScores = OIBTree() wordScores = OIBTree()
last = None last = None
...@@ -686,8 +681,6 @@ class TextIndex(PluggableIndex.PluggableIndex, Persistent, ...@@ -686,8 +681,6 @@ class TextIndex(PluggableIndex.PluggableIndex, Persistent,
REQUEST=None,RESPONSE=None,URL2=None): REQUEST=None,RESPONSE=None,URL2=None):
""" preferences of TextIndex """ """ preferences of TextIndex """
# self.useSplitter = splitter
# self.useOperator = text_operator
if self.vocabulary_id != vocabulary: if self.vocabulary_id != vocabulary:
self.clear() self.clear()
......
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