def keep_allowed_chars(text):
    """
    Cleans the text for output
    """
    #     print ','.join(str(ord(c)) for c in text)
    return "".join(" " if c == "\n" else c for c in text.strip() if _allowed_char(c))
Cleans the text for output