[Zope-Checkins] CVS: Zope/lib/python/Products/PluginIndexes/TextIndex - TextIndex.py:1.12
Andreas Jung
andreas@zope.com
Wed, 8 Aug 2001 14:15:31 -0400
Update of /cvs-repository/Zope/lib/python/Products/PluginIndexes/TextIndex
In directory cvs.zope.org:/tmp/cvs-serv29228/PluginIndexes/TextIndex
Modified Files:
TextIndex.py
Log Message:
Made aquisition of vocabularies for TextIndexes working.
=== Zope/lib/python/Products/PluginIndexes/TextIndex/TextIndex.py 1.11 => 1.12 ===
self.clear()
- if extra: self.vocabulary_id = extra.vocabulary
- else: self.vocabulary_id = "Vocabulary"
+ if extra:
+ self.vocabulary_id = extra.vocabulary
+ self.catalog = extra.catalog
+ else:
+ self.vocabulary_id = "Vocabulary"
+ self.catalog = None
+
+
self._lexicon = None
@@ -198,13 +204,16 @@
self.vocabulary_id = '__userdefined__'
+
def getLexicon(self, vocab_id=None):
"""Return the Lexicon in use. Removed lots of stinking code"""
+
+
if self._lexicon is None:
## if no lexicon is provided, create a default one
try:
- self._lexicon = self.aq_parent.getattr(self.vocabulary_id).getLexicon()
+ self._lexicon = getattr(self.catalog,self.vocabulary_id).getLexicon()
except:
self._lexicon = Lexicon()
self.vocabulary_id = '__intern__'
@@ -348,6 +357,7 @@
return 0
lexicon = self.getLexicon()
+
splitter = lexicon.Splitter
wordScores = OIBTree()