[Zope-Checkins] CVS: Zope/lib/python/Products/PluginIndexes/TextIndexNG - BaseNormalizer.py:1.1.2.3
Andreas Jung
andreas@digicool.com
Mon, 11 Feb 2002 22:11:49 -0500
Update of /cvs-repository/Zope/lib/python/Products/PluginIndexes/TextIndexNG
In directory cvs.zope.org:/tmp/cvs-serv12050
Modified Files:
Tag: ajung-textindexng-branch
BaseNormalizer.py
Log Message:
added getTable()
=== Zope/lib/python/Products/PluginIndexes/TextIndexNG/BaseNormalizer.py 1.1.2.2 => 1.1.2.3 ===
'Unknown type for normalizer constructor'
+ self.getTable = self._normalizer.getTable
def normalize(self, arg):
""" normalize the string/sequence of strings """
@@ -51,6 +52,7 @@
__call__ = normalize
+
def readTable(self, fname):
""" read a translation table """
@@ -68,7 +70,16 @@
fields = l.strip().split()
- d.append( (fields[0], fields[1]) )
+ k = fields[0]
+ v = fields[1]
+
+ if k.find("'")>-1 or k.find('"')>-1:
+ k = eval (k)
+
+ if v.find("'")>-1 or v.find('"')>-1:
+ v = eval (v)
+
+ d.append( (k, v) )
return d