

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

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