Spaces:
Running
Running
File size: 308 Bytes
751936e |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
def is_chinese(uchar):
"""
https://github.com/fxsjy/jieba/blob/master/jieba/__init__.py#L48
re.compile("([\u4E00-\u9FD5]+)", re.U)
"""
return u'\u4e00' <= uchar <= u'\u9fa5'
def has_chinese(text):
""" contains Chinese characters """
return any(is_chinese(ch) for ch in text) |