

def replace(self, oldtext, newtext):

    def rep(w):
        if (w == oldtext):
            return newtext
        else:
            return w
    return Phrase(self.fieldname, [rep(w) for w in self.words], slop=self.slop, boost=oldtext.boost)

dataset/ETHPy150Open dokipen/whoosh/src/whoosh/query.py Phrase.replace/VarMisuse@73/85 `self`->`oldtext`