# Conflicts:
#	.idea/workspace.xml
#	Module/FlaskService.py
#	Utils/AiUtils.py
#	tidevice_entry.py
This commit is contained in:
2025-09-05 16:34:58 +08:00
13 changed files with 116 additions and 189 deletions

View File

@@ -459,3 +459,18 @@ class AiUtils(object):
return t
return ""
# 检查字符串中是否包含中文
@classmethod
def contains_chinese(cls, text):
"""
判断字符串中是否包含中文字符。
参数:
text (str): 要检测的字符串。
返回:
bool: 如果字符串中包含中文,返回 True否则返回 False。
"""
# 使用正则表达式匹配中文字符
pattern = re.compile(r'[\u4e00-\u9fff]')
return bool(pattern.search(text))