(self, query_fragment)
return ' '.join(cleaned_words)
Provides a mechanism for sanitizing user input before presenting the
        value to the backend.

        Whoosh 1.X differs here in that you can no longer use a backslash
        to escape reserved characters. Instead, the whole word should be
        quoted.
Provides a mechanism for sanitizing user input before presenting the
        value to the backend.
Provides a mechanism for sanitizing user input before presenting the value to the backend .
def clean(self, query_fragment):
        """
        Provides a mechanism for sanitizing user input before presenting the
        value to the backend.

        Whoosh 1.X differs here in that you can no longer use a backslash
        to escape reserved characters. Instead, the whole word should be
        quoted.
        """
        words = query_fragment.split()
        cleaned_words = []

        for word in words:
            if word in self.backend.RESERVED_WORDS:
                word = word.replace(word, word.lower())

            for char in self.backend.RESERVED_CHARACTERS:
                if char in word:
                    word = "'%s'" % word
                    break

            cleaned_words.append(word)

        return ' '.join(cleaned_words)
def clean ( self , query_fragment ) : words = query_fragment . split ( ) cleaned_words = [ ] for word in words : if word in self . backend . RESERVED_WORDS : word = word . replace ( word , word . lower ( ) ) for char in self . backend . RESERVED_CHARACTERS : if char in word : word = "'%s'" % word break cleaned_words . append ( word ) return ' ' . join ( cleaned_words )