Skip to content

Commit

Permalink
Merge pull request #1026 from PyThaiNLP/update-5.0
Browse files Browse the repository at this point in the history
Add clause_tokenize warnings
  • Loading branch information
bact authored Dec 12, 2024
2 parents f0d6d71 + 8c4ecbb commit 79e5d58
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions pythainlp/tokenize/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
Generic functions of tokenizers
"""
import re
import warnings
from typing import Iterable, List, Union

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

warnings.warn(
"""
clause_tokenize is no longer supported \
and will be removed in version 5.1.
""", DeprecationWarning)
return segment(doc)


Expand Down

0 comments on commit 79e5d58

Please sign in to comment.