Example #1
0
    def compare(self, element, terms):
        badList = self.c.replace_this.split(';')
        replaceList = self.c.with_this.split(';')
        if len(badList) != len(replaceList):
            log.warning('The two config fields from %s do not match in length check your ->;' % self)
            return terms
        replaceDict = {}
        for index, badThing in enumerate(badList):
            replaceDict[badThing] = replaceList[index]

        out = list(terms)
        for t in terms:
            out.append(replace_x(t, replaceDict))
        return out
Example #2
0
    def compare(self, element, terms):
        badList = self.c.replace_this.split(';')
        replaceList = self.c.with_this.split(';')
        if len(badList) != len(replaceList):
            log.warning(
                'The two config fields from %s do not match in lenght check your ->;'
                % self)
            return terms
        replaceDict = {}
        for index, badThing in enumerate(badList):
            replaceDict[badThing] = replaceList[index]

        out = list(terms)
        for t in terms:
            out.append(replace_x(t, replaceDict))
        return out
Example #3
0
 def compare(self, element, terms):
     log('Fixing diacritics for %s and %s' % (element, terms))
     out = list(terms)
     for t in terms:
         out.append(replace_x(t, self._map))
     return out
Example #4
0
 def compare(self, element, terms):
     log('Fixing diacritics for %s and %s' % (element, terms))
     out = list(terms)
     for t in terms:
         out.append(replace_x(t, self._map))
     return out