[Zope-Checkins] CVS: Zope/lib/python/Products/PluginIndexes/TextIndex - GlobbingLexicon.py:1.2.4.2
Andreas Jung
andreas@zope.com
Thu, 11 Oct 2001 10:37:30 -0400
Update of /cvs-repository/Zope/lib/python/Products/PluginIndexes/TextIndex
In directory cvs.zope.org:/tmp/cvs-serv26099/lib/python/Products/PluginIndexes/TextIndex
Modified Files:
Tag: Zope-2_4-branch
GlobbingLexicon.py
Log Message:
queries with single-letter words produced a slicing error in get()
=== Zope/lib/python/Products/PluginIndexes/TextIndex/GlobbingLexicon.py 1.2.4.1 => 1.2.4.2 ===
def get(self, pattern):
""" Query the lexicon for words matching a pattern."""
+
+ # single word pattern produce a slicing problem below.
+ # Because the splitter throws away single characters we can
+ # return an empty tuple here.
+ if len(pattern)==1: return ()
+
wc_set = [self.multi_wc, self.single_wc]
digrams = []