# Path: pypinyin/compat.py
# SUPPORT_UCS4 = len('\U00020000') == 1
# PY2 = sys.version_info < (3, 0)
#     PY2 = False  # pragma: no cover
#     def callable_check(obj):
# 
# Path: pypinyin/constants.py
# RE_HANS = re.compile(
#     r'^(?:['
#     r'\u3007'                  # 〇
#     r'\ue815-\ue864'
#     r'\ufa18'
#     r'\u3400-\u4dbf'           # CJK扩展A:[3400-4DBF]
#     r'\u4e00-\u9fff'           # CJK基本:[4E00-9FFF]
#     r'\uf900-\ufaff'           # CJK兼容:[F900-FAFF]
#     r'\U00020000-\U0002A6DF'   # CJK扩展B:[20000-2A6DF]
#     r'\U0002A703-\U0002B73F'   # CJK扩展C:[2A700-2B73F]
#     r'\U0002B740-\U0002B81D'   # CJK扩展D:[2B740-2B81D]
#     r'\U0002B825-\U0002BF6E'
#     r'\U0002C029-\U0002CE93'
#     r'\U0002D016'
#     r'\U0002F80A-\U0002FA1F'   # CJK兼容扩展:[2F800-2FA1F]
#     r'\U00030EDD'
#     r'\U00030EDE'
#     r'])+$'
# )
# 
# PHRASES_DICT = {}
# 
# Path: pypinyin/seg/mmseg.py
# class Seg(object):
# class PrefixSet(object):
#     def __init__(self, prefix_set, no_non_phrases=False):
#     def cut(self, text):
#     def train(self, words):
#     def __init__(self):
#     def train(self, word_s):
#     def __contains__(self, key):
# def retrain(seg_instance):


from itertools import chain
from pypinyin.compat import text_type, bytes_type
from pypinyin.constants import RE_HANS, PHRASES_DICT
from pypinyin.seg import mmseg
        if not RE_HANS.match(x):   # 没有拼音的字符，不再参与二次分词
            ret.append(x)
        elif PHRASES_DICT:
            ret.extend(list(mmseg.seg.cut(x)))
        else:   # 禁用了词语库，不分词
            ret.append(x)
    return ret


def simple_seg(hans):
    """将传入的字符串按是否是汉字来分割"""
    assert not isinstance(hans, bytes_type), \
        'must be unicode string or [unicode, ...] list'

    if isinstance(hans, text_type):
        return _seg(hans)
    else:
        hans = list(hans)
        if len(hans) == 1:
            return simple_seg(hans[0])
        return list(chain(*[simple_seg(x) for x in hans]))


def _seg(chars):
    """按是否是汉字进行分词"""
    s = ''  # 保存一个词
    ret = []  # 分词结果
    flag = 0  # 上一个字符是什么? 0: 汉字, 1: 不是汉字

    for n, c in enumerate(chars):

# Path: pypinyin/compat.py
# SUPPORT_UCS4 = len('\U00020000') == 1
# PY2 = sys.version_info < (3, 0)
#     PY2 = False  # pragma: no cover
#     def callable_check(obj):
# 
# Path: pypinyin/constants.py
# RE_HANS = re.compile(
#     r'^(?:['
#     r'\u3007'                  # 〇
#     r'\ue815-\ue864'
#     r'\ufa18'
#     r'\u3400-\u4dbf'           # CJK扩展A:[3400-4DBF]
#     r'\u4e00-\u9fff'           # CJK基本:[4E00-9FFF]
#     r'\uf900-\ufaff'           # CJK兼容:[F900-FAFF]
#     r'\U00020000-\U0002A6DF'   # CJK扩展B:[20000-2A6DF]
#     r'\U0002A703-\U0002B73F'   # CJK扩展C:[2A700-2B73F]
#     r'\U0002B740-\U0002B81D'   # CJK扩展D:[2B740-2B81D]
#     r'\U0002B825-\U0002BF6E'
#     r'\U0002C029-\U0002CE93'
#     r'\U0002D016'
#     r'\U0002F80A-\U0002FA1F'   # CJK兼容扩展:[2F800-2FA1F]
#     r'\U00030EDD'
#     r'\U00030EDE'
#     r'])+$'
# )
# 
# PHRASES_DICT = {}
# 
# Path: pypinyin/seg/mmseg.py
# class Seg(object):
# class PrefixSet(object):
#     def __init__(self, prefix_set, no_non_phrases=False):
#     def cut(self, text):
#     def train(self, words):
#     def __init__(self):
#     def train(self, word_s):
#     def __contains__(self, key):
# def retrain(seg_instance):


# Path: pypinyin/seg/simpleseg.py
from itertools import chain
from pypinyin.compat import text_type, bytes_type
from pypinyin.constants import RE_HANS, PHRASES_DICT
from pypinyin.seg import mmseg

        if not RE_HANS.match(x):   # 没有拼音的字符，不再参与二次分词
            ret.append(x)
        elif PHRASES_DICT:
            ret.extend(list(mmseg.seg.cut(x)))
        else:   # 禁用了词语库，不分词
            ret.append(x)
    return ret


def simple_seg(hans):
    """将传入的字符串按是否是汉字来分割"""
    assert not isinstance(hans, bytes_type), \
        'must be unicode string or [unicode, ...] list'

    if isinstance(hans, text_type):
        return _seg(hans)
    else:
        hans = list(hans)
        if len(hans) == 1:
            return simple_seg(hans[0])
        return list(chain(*[simple_seg(x) for x in hans]))


def _seg(chars):
    """按是否是汉字进行分词"""
    s = ''  # 保存一个词
    ret = []  # 分词结果
    flag = 0  # 上一个字符是什么? 0: 汉字, 1: 不是汉字

    for n, c in enumerate(chars):

        if RE_HANS.match(c):  # 汉字, 确定 flag 的初始值