Exemple #1
0
    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, " ")
Exemple #2
0
    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, " ")
Exemple #3
0
    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, "")
Exemple #4
0
    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, "")
Exemple #5
0
    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, " ")
Exemple #6
0
    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, " ")
Exemple #7
0
    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")
Exemple #8
0
 def placeholder_rt_tag(text):
     return RegexFilters.replace_rt_tag(text, Filters.RTTAG_PLACEHOLDER)
Exemple #9
0
 def remove_non_syntactical_text_plus(text):
     return RegexFilters.replace_non_syntactical_text_plus(text, " ")
Exemple #10
0
 def placeholder_url(text):
     return RegexFilters.replace_url(text, Filters.URL_PLACEHOLDER)
Exemple #11
0
 def remove_emoticons(text):
     return RegexFilters.replace_emoticons(text, "")
Exemple #12
0
 def remove_rt_tag(text):
     return RegexFilters.replace_rt_tag(text, "")
Exemple #13
0
 def protect_hashtag(text):
     return RegexFilters.replace_hashtag(text, " ||#$1|| ")
Exemple #14
0
 def hashtag_to_word(text):
     return RegexFilters.replace_hashtag(text, "$1")
Exemple #15
0
 def placeholder_hashtag(text):
     return RegexFilters.replace_hashtag(text, Filters.HASHTAG_PLACEHOLDER)
Exemple #16
0
 def placeholder_username(text):
     return RegexFilters.replace_username(text,
                                          Filters.USERNAME_PLACEHOLDER)
Exemple #17
0
 def remove_username(text):
     return RegexFilters.replace_username(text, "")
Exemple #18
0
 def remove_url(text):
     return RegexFilters.replace_url(text, "")
Exemple #19
0
 def parse_emoticons(text):
     return RegexFilters.replace_emoticons(text, " ||$1|| ")