

def replace(self, oldtext, newtext):
    if (oldtext == self.text):
        return Variations(self.fieldname, newtext, boost=self.boost)
    else:
        return self

dataset/ETHPy150Open dokipen/whoosh/src/whoosh/query.py Variations.replace/original