Merge branch 'main' of http://49.235.115.212:3000/zw/iOSAI
# Conflicts: # .idea/workspace.xml # Module/FlaskService.py # Utils/AiUtils.py # tidevice_entry.py
This commit is contained in:
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user