MCPcopy Create free account
hub / github.com/OpenBitSys/BitDistiller / zh_split

Function zh_split

test/general/lm_eval/tasks/translation.py:78–86  ·  view source on GitHub ↗

Chinese splitting

(zh_text: List[str])

Source from the content-addressed store, hash-verified

76
77
78def zh_split(zh_text: List[str]) -> List[str]:
79 """Chinese splitting"""
80 if not HAS_JIEBA:
81 raise ImportError(
82 "Chinese text splitting requires the `jieba` package. "
83 "Please install it with:\npip install jieba"
84 )
85
86 return [" ".join(jieba.cut(txt.strip())) for txt in zh_text]
87
88
89def ja_split(ja_text: List[str]) -> List[str]:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected