mirror of
https://github.com/jxxghp/MoviePilot.git
synced 2026-05-30 07:26:48 +00:00
11 lines
315 B
Python
11 lines
315 B
Python
"""中文分词工具。"""
|
|
|
|
from jieba_next import cut as jieba_next_cut
|
|
|
|
|
|
def cut(text: str, HMM: bool = True, cut_all: bool = False) -> list[str]:
|
|
"""
|
|
使用 jieba-next 执行中文分词,并兼容 jieba.cut 的常用参数名。
|
|
"""
|
|
return list(jieba_next_cut(text, HMM=HMM, cut_all=cut_all))
|