Commit 2dd0c34f authored by Andreas Jung's avatar Andreas Jung

TextIndex now takes care of unicode queries

parent 17db1930
...@@ -87,7 +87,7 @@ ...@@ -87,7 +87,7 @@
""" """
__version__ = '$Revision: 1.17 $'[11:-2] __version__ = '$Revision: 1.18 $'[11:-2]
import string, re import string, re
...@@ -464,6 +464,7 @@ class TextIndex(PluggableIndex.PluggableIndex, Persistent, ...@@ -464,6 +464,7 @@ class TextIndex(PluggableIndex.PluggableIndex, Persistent,
result = self._index.get(word, {}) result = self._index.get(word, {})
return ResultList(result, (word,), self) return ResultList(result, (word,), self)
else: else:
splitSource = tuple(self.getLexicon().Splitter(word)) splitSource = tuple(self.getLexicon().Splitter(word))
if not splitSource: if not splitSource:
...@@ -629,7 +630,8 @@ class TextIndex(PluggableIndex.PluggableIndex, Persistent, ...@@ -629,7 +630,8 @@ class TextIndex(PluggableIndex.PluggableIndex, Persistent,
operandType = type(left) operandType = type(left)
if operandType is IntType: if operandType is IntType:
left = self[left] left = self[left]
elif operandType is StringType: elif isinstance(operandType,StringType) or \
isinstance(operandType,UnicodeType):
left = self[left] left = self[left]
elif operandType is ListType: elif operandType is ListType:
left = self.evaluate(left) left = self.evaluate(left)
...@@ -637,7 +639,8 @@ class TextIndex(PluggableIndex.PluggableIndex, Persistent, ...@@ -637,7 +639,8 @@ class TextIndex(PluggableIndex.PluggableIndex, Persistent,
operandType = type(right) operandType = type(right)
if operandType is IntType: if operandType is IntType:
right = self[right] right = self[right]
elif operandType is StringType: elif isinstance(operandType,StringType) or \
isinstance(operandType,UnicodeType):
right = self[right] right = self[right]
elif operandType is ListType: elif operandType is ListType:
right = self.evaluate(right) right = self.evaluate(right)
......
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