We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 15471e2 commit 7479baaCopy full SHA for 7479baa
pythainlp/tokenize/crfcut.py
@@ -189,7 +189,10 @@ def segment(text: str) -> List[str]:
189
:param str text: text to be tokenized to sentences
190
:return: list of words, tokenized from the text
191
"""
192
- toks = word_tokenize(text)
+ if isinstance(text, str):
193
+ toks = word_tokenize(text)
194
+ else:
195
+ toks = text
196
feat = extract_features(toks)
197
labs = _tagger.tag(feat)
198
labs[-1] = "E" # make sure it cuts the last sentence
0 commit comments