def counter_from_str ( self , string ) : string_list = [ chars for chars in string if chars not in self . punctuation ] string_joined = '' . join ( string_list ) tokens = self . punkt . word_tokenize ( string_joined ) return Counter ( tokens )
use python to word count and remove punctuation
Build word frequency list from incoming string .
def counter_from_str(self, string):
        """Build word frequency list from incoming string."""
        string_list = [chars for chars in string if chars not in self.punctuation]
        string_joined = ''.join(string_list)
        tokens = self.punkt.word_tokenize(string_joined)
        return Counter(tokens)