MCPcopy Index your code
hub / github.com/ChinaGodMan/UserScripts / clean_text

Function clean_text

utils/userscript_localization_tool.py:14–21  ·  view source on GitHub ↗
(text)

Source from the content-addressed store, hash-verified

12
13# 清理不规则的文本
14def clean_text(text):
15 # 替换多个空格或特殊空白字符为单个空格
16 text = re.sub(r"[\u200b\u00a0\t]+", " ", text)
17 # 替换多余的连续空格为单个空格
18 text = re.sub(r" +", " ", text)
19 # 去除行尾空格
20 text = re.sub(r"\s+$", "", text)
21 return text
22
23
24# 在meta中插入翻译的区域化

Callers 1

translate_and_collectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected