

def normalize(self):
    text = self.text
    if (text == '*'):
        return Every(boost=self.boost)
    if (('*' not in text) and ('?' not in text)):
        return Term(text.fieldname, self.text, boost=self.boost)
    elif (('?' not in text) and text.endswith('*') and (text.find('*') == (len(text) - 1)) and ((len(text) < 2) or (text[(- 2)] != '\\'))):
        return Prefix(self.fieldname, self.text[:(- 1)], boost=self.boost)
    else:
        return self

dataset/ETHPy150Open dokipen/whoosh/src/whoosh/query.py Wildcard.normalize/VarMisuse@58/64 `self`->`text`