def _parse_from_text(self, text):
if not isinstance(text, str):<EOL><INDENT>raise MarkovTextExcept("<STR_LIT>")<EOL><DEDENT>text = text.strip().lower()<EOL>need_start_token = True<EOL>token = "<STR_LIT:$>"  <EOL>for token in self.WORD_OR_MARKS.finditer(text):<EOL><INDENT>token = token.group()<EOL>if need_start_token:<EOL><INDENT>need_start_token = False<EOL>yield "<STR_LIT>"<EOL><DEDENT>yield token<EOL>if self.END_TOKENS.search(token):<EOL><INDENT>need_start_token = True<EOL>yield "<STR_LIT:$>"<EOL><DEDENT><DEDENT>if token != "<STR_LIT:$>":<EOL><INDENT>yield "<STR_LIT:$>"<EOL><DEDENT>
Возвращает генератор токенов, из текста.