Checks whether the first character in text is one of a punctuation, control or whitespace character.
(text)
| 90 | |
| 91 | |
| 92 | def _is_start_of_word(text): |
| 93 | """Checks whether the first character in text is one of a punctuation, control or whitespace character.""" |
| 94 | first_char = text[0] |
| 95 | return bool(_is_control(first_char) | _is_punctuation(first_char) | _is_whitespace(first_char)) |
| 96 | |
| 97 | |
| 98 | class PreTrainedTokenizer(PreTrainedTokenizerBase): |
no test coverage detected