Skip to content

Commit 79e5d58

Browse files
authored
Merge pull request #1026 from PyThaiNLP/update-5.0
Add clause_tokenize warnings
2 parents f0d6d71 + 8c4ecbb commit 79e5d58

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pythainlp/tokenize/core.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
Generic functions of tokenizers
66
"""
77
import re
8+
import warnings
89
from typing import Iterable, List, Union
910

1011
from pythainlp.tokenize import (
@@ -29,6 +30,9 @@ def clause_tokenize(doc: List[str]) -> List[List[str]]:
2930
Tokenizes running word list into list of clauses (list of strings).
3031
Split by CRF trained on Blackboard Treebank.
3132
33+
**Warning**: *clause_tokenize* is no longer supported\
34+
and will be removed in version 5.1.
35+
3236
:param str doc: word list to be clause tokenized
3337
:return: list of clauses
3438
:rtype: list[list[str]]
@@ -43,6 +47,11 @@ def clause_tokenize(doc: List[str]) -> List[List[str]]:
4347
"""
4448
from pythainlp.tokenize.crfcls import segment
4549

50+
warnings.warn(
51+
"""
52+
clause_tokenize is no longer supported \
53+
and will be removed in version 5.1.
54+
""", DeprecationWarning)
4655
return segment(doc)
4756

4857

0 commit comments

Comments
 (0)