def _run_split_on_punc(self, text):
chars = list(text)<EOL>i = <NUM_LIT:0><EOL>start_new_word = True<EOL>output = []<EOL>while i < len(chars):<EOL><INDENT>char = chars[i]<EOL>if self._is_punctuation(char):<EOL><INDENT>output.append([char])<EOL>start_new_word = True<EOL><DEDENT>else:<EOL><INDENT>if start_new_word:<EOL><INDENT>output.append([])<EOL><DEDENT>start_new_word = False<EOL>output[-<NUM_LIT:1>].append(char)<EOL><DEDENT>i += <NUM_LIT:1><EOL><DEDENT>return ['<STR_LIT>'.join(x) for x in output]<EOL>
Splits punctuation on a piece of text.