def remove_free_digits(text): """ Removes free standing digits (digits not part of a word) :param text: String to format (f.ex. "Only 90s kids will get this 1337 m8") :return: The formatted String (f.ex. "Only 90s kids will get this m8") """ return RegexFilters.replace_free_digits(text, " ")
def remove_repeated_whitespace(text): """ Removes repeated whitespace :param text: String to format (f.ex. "A string with maany spaces ") :return: The formatted String (f.ex. "A string with many spaces ") """ return RegexFilters.replace_whitespace(text, " ")
def remove_non_alphabetic_text(text): """ Removes non alphabetic characters :param text: String to format (f.ex "Hey, m8!") :return: The formatted String (f.ex. "Hey m") """ return RegexFilters.replace_non_alphabetic_text(text, "")
def remove_inner_word_characters(text): """ Removes characters which are often part of a word (mostly apostrophes) :param text: String to format (f.ex. "Here's a sentence!") :return: The formatted String (f.ex. "Heres a sentence!") """ return RegexFilters.replace_inner_word_characters(text, "")
def remove_non_alphanumerical_text(text): """ Removes non-alphanumerical characters :param text: String to format (f.ex "It's very nice!") :return: The formatted String (f.ex "It s very nice ") """ return RegexFilters.replace_non_alphanumerical_text(text, " ")
def remove_non_syntactical_text(text): """ Removes all non-alphabetic or basic punctuation characters (!?,. ) :param text: String to format (f.ex. "This is' a #crazy tæst") :return: The formatted String (f.ex. "This is a crazy tst") """ return RegexFilters.replace_non_syntactical_text(text, " ")
def remove_repeating_characters(text): """ Replaces repeating characters in String :param text: String to format (f.ex. "Today is a greeeeeeaaaaaaat dayy!") :return: The formatted String (f.ex. "Today is a great day!") """ return RegexFilters.replace_repeating_characters(text, "$1")
def placeholder_rt_tag(text): return RegexFilters.replace_rt_tag(text, Filters.RTTAG_PLACEHOLDER)
def remove_non_syntactical_text_plus(text): return RegexFilters.replace_non_syntactical_text_plus(text, " ")
def placeholder_url(text): return RegexFilters.replace_url(text, Filters.URL_PLACEHOLDER)
def remove_emoticons(text): return RegexFilters.replace_emoticons(text, "")
def remove_rt_tag(text): return RegexFilters.replace_rt_tag(text, "")
def protect_hashtag(text): return RegexFilters.replace_hashtag(text, " ||#$1|| ")
def hashtag_to_word(text): return RegexFilters.replace_hashtag(text, "$1")
def placeholder_hashtag(text): return RegexFilters.replace_hashtag(text, Filters.HASHTAG_PLACEHOLDER)
def placeholder_username(text): return RegexFilters.replace_username(text, Filters.USERNAME_PLACEHOLDER)
def remove_username(text): return RegexFilters.replace_username(text, "")
def remove_url(text): return RegexFilters.replace_url(text, "")
def parse_emoticons(text): return RegexFilters.replace_emoticons(text, " ||$1|| ")