MCPcopy Create free account
hub / github.com/hankcs/HanLP / ispunct

Function ispunct

hanlp/utils/string_util.py:12–14  ·  view source on GitHub ↗
(token)

Source from the content-addressed store, hash-verified

10
11
12def ispunct(token):
13 return all(unicodedata.category(char).startswith('P')
14 for char in token)
15
16
17def split_long_sentence_into(tokens: List[str], max_seq_length, sent_delimiter=None, char_level=False,

Callers 5

__call__Method · 0.90
__init__Method · 0.90
load_fileMethod · 0.90
lock_vocabsMethod · 0.90
split_long_sentence_intoFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…