def _preprocess_text(text):
    """
    Prepare a string for syntaxic treatment (encode to utf-8, remove
    leading/trailing whitespace, etc...).
    """
    return text.encode('utf-8').strip(' \t\r\n').lower()