コード例 #1
0
ファイル: Replace.py プロジェクト: DINKIN/XDM
    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
コード例 #2
0
ファイル: Replace.py プロジェクト: ragnvaldur/XDM
    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
コード例 #3
0
ファイル: Diacritics.py プロジェクト: Torf/XDM-French-Touch
 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
コード例 #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