def word_split(self, sentence): words = re.split(self.word_split_pattern, sentence) words = [w for w in words if len(w) > 0] words = ["::".join(tag) for tag in nltk.pos_tag(words)] return words