Module text

Module text 

Source
Expand description

文本工具函数

Functions§

contains_cjk
检查文本是否包含CJK字符
is_mostly_ascii
检查文本是否主要由ASCII字符组成
similarity
计算文本相似度
truncate_words
截断文本到指定长度,保持单词完整性
word_count
统计文本中的单词数