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=self.boost)
dataset/ETHPy150Open dokipen/whoosh/src/whoosh/query.py/Phrase.replace/original