Python jieba 模块,dt() 实例源码

我们从Python开源项目中,提取了以下27个代码示例,用于说明如何使用jieba.dt()

项目:PTTChatBot_DL2017    作者:thisray    | 项目源码 | 文件源码
def cut(sentence, HMM=True):
    """
    Global `cut` function that supports parallel processing.

    Note that this only works using dt, custom POSTokenizer
    instances are not supported.
    """
    global dt
    if jieba.pool is None:
        for w in dt.cut(sentence, HMM=HMM):
            yield w
    else:
        parts = strdecode(sentence).splitlines(True)
        if HMM:
            result = jieba.pool.map(_lcut_internal, parts)
        else:
            result = jieba.pool.map(_lcut_internal_no_hmm, parts)
        for r in result:
            for w in r:
                yield w
项目:ChineseSA    作者:cwlseu    | 项目源码 | 文件源码
def cut(sentence, HMM=True):
    """
    Global `cut` function that supports parallel processing.

    Note that this only works using dt, custom POSTokenizer
    instances are not supported.
    """
    global dt
    if jieba.pool is None:
        for w in dt.cut(sentence, HMM=HMM):
            yield w
    else:
        parts = strdecode(sentence).splitlines(True)
        if HMM:
            result = jieba.pool.map(_lcut_internal, parts)
        else:
            result = jieba.pool.map(_lcut_internal_no_hmm, parts)
        for r in result:
            for w in r:
                yield w
项目:Malicious_Domain_Whois    作者:h-j-13    | 项目源码 | 文件源码
def cut(sentence, HMM=True):
    """
    Global `cut` function that supports parallel processing.

    Note that this only works using dt, custom POSTokenizer
    instances are not supported.
    """
    global dt
    if jieba.pool is None:
        for w in dt.cut(sentence, HMM=HMM):
            yield w
    else:
        parts = strdecode(sentence).splitlines(True)
        if HMM:
            result = jieba.pool.map(_lcut_internal, parts)
        else:
            result = jieba.pool.map(_lcut_internal_no_hmm, parts)
        for r in result:
            for w in r:
                yield w
项目:jieba-GAE    作者:liantian-cn    | 项目源码 | 文件源码
def cut(sentence, HMM=True):
    """
    Global `cut` function that supports parallel processing.

    Note that this only works using dt, custom POSTokenizer
    instances are not supported.
    """
    global dt
    if jieba.pool is None:
        for w in dt.cut(sentence, HMM=HMM):
            yield w
    else:
        parts = strdecode(sentence).splitlines(True)
        if HMM:
            result = jieba.pool.map(_lcut_internal, parts)
        else:
            result = jieba.pool.map(_lcut_internal_no_hmm, parts)
        for r in result:
            for w in r:
                yield w
项目:my_bit_v1    作者:iSawyer    | 项目源码 | 文件源码
def cut(sentence, HMM=True):
    """
    Global `cut` function that supports parallel processing.

    Note that this only works using dt, custom POSTokenizer
    instances are not supported.
    """
    global dt
    if jieba.pool is None:
        for w in dt.cut(sentence, HMM=HMM):
            yield w
    else:
        parts = strdecode(sentence).splitlines(True)
        if HMM:
            result = jieba.pool.map(_lcut_internal, parts)
        else:
            result = jieba.pool.map(_lcut_internal_no_hmm, parts)
        for r in result:
            for w in r:
                yield w
项目:http_server    作者:chenguolin    | 项目源码 | 文件源码
def cut(sentence, HMM=True):
    """
    Global `cut` function that supports parallel processing.

    Note that this only works using dt, custom POSTokenizer
    instances are not supported.
    """
    global dt
    if jieba.pool is None:
        for w in dt.cut(sentence, HMM=HMM):
            yield w
    else:
        parts = strdecode(sentence).splitlines(True)
        if HMM:
            result = jieba.pool.map(_lcut_internal, parts)
        else:
            result = jieba.pool.map(_lcut_internal_no_hmm, parts)
        for r in result:
            for w in r:
                yield w
项目:http_server    作者:chenguolin    | 项目源码 | 文件源码
def cut(sentence, HMM=True):
    """
    Global `cut` function that supports parallel processing.

    Note that this only works using dt, custom POSTokenizer
    instances are not supported.
    """
    global dt
    if jieba.pool is None:
        for w in dt.cut(sentence, HMM=HMM):
            yield w
    else:
        parts = strdecode(sentence).splitlines(True)
        if HMM:
            result = jieba.pool.map(_lcut_internal, parts)
        else:
            result = jieba.pool.map(_lcut_internal_no_hmm, parts)
        for r in result:
            for w in r:
                yield w
项目:PTTChatBot_DL2017    作者:thisray    | 项目源码 | 文件源码
def _lcut_internal(s):
    return dt._lcut_internal(s)
项目:PTTChatBot_DL2017    作者:thisray    | 项目源码 | 文件源码
def _lcut_internal_no_hmm(s):
    return dt._lcut_internal_no_hmm(s)
项目:PTTChatBot_DL2017    作者:thisray    | 项目源码 | 文件源码
def __init__(self, idf_path=None):
        self.tokenizer = jieba.dt
        self.postokenizer = jieba.posseg.dt
        self.stop_words = self.STOP_WORDS.copy()
        self.idf_loader = IDFLoader(idf_path or DEFAULT_IDF)
        self.idf_freq, self.median_idf = self.idf_loader.get_idf()
项目:ChineseSA    作者:cwlseu    | 项目源码 | 文件源码
def _lcut_internal(s):
    return dt._lcut_internal(s)
项目:ChineseSA    作者:cwlseu    | 项目源码 | 文件源码
def _lcut_internal_no_hmm(s):
    return dt._lcut_internal_no_hmm(s)
项目:ChineseSA    作者:cwlseu    | 项目源码 | 文件源码
def __init__(self, idf_path=None):
        self.tokenizer = jieba.dt
        self.postokenizer = jieba.posseg.dt
        self.stop_words = self.STOP_WORDS.copy()
        self.idf_loader = IDFLoader(idf_path or DEFAULT_IDF)
        self.idf_freq, self.median_idf = self.idf_loader.get_idf()
项目:Malicious_Domain_Whois    作者:h-j-13    | 项目源码 | 文件源码
def _lcut_internal(s):
    return dt._lcut_internal(s)
项目:Malicious_Domain_Whois    作者:h-j-13    | 项目源码 | 文件源码
def _lcut_internal_no_hmm(s):
    return dt._lcut_internal_no_hmm(s)
项目:Malicious_Domain_Whois    作者:h-j-13    | 项目源码 | 文件源码
def __init__(self, idf_path=None):
        self.tokenizer = jieba.dt
        self.postokenizer = jieba.posseg.dt
        self.stop_words = self.STOP_WORDS.copy()
        self.idf_loader = IDFLoader(idf_path or DEFAULT_IDF)
        self.idf_freq, self.median_idf = self.idf_loader.get_idf()
项目:jieba-GAE    作者:liantian-cn    | 项目源码 | 文件源码
def _lcut_internal(s):
    return dt._lcut_internal(s)
项目:jieba-GAE    作者:liantian-cn    | 项目源码 | 文件源码
def _lcut_internal_no_hmm(s):
    return dt._lcut_internal_no_hmm(s)
项目:jieba-GAE    作者:liantian-cn    | 项目源码 | 文件源码
def __init__(self, idf_path=None):
        self.tokenizer = jieba.dt
        self.postokenizer = jieba.posseg.dt
        self.stop_words = self.STOP_WORDS.copy()
        self.idf_loader = IDFLoader(idf_path or DEFAULT_IDF)
        self.idf_freq, self.median_idf = self.idf_loader.get_idf()
项目:my_bit_v1    作者:iSawyer    | 项目源码 | 文件源码
def _lcut_internal(s):
    return dt._lcut_internal(s)
项目:my_bit_v1    作者:iSawyer    | 项目源码 | 文件源码
def _lcut_internal_no_hmm(s):
    return dt._lcut_internal_no_hmm(s)
项目:my_bit_v1    作者:iSawyer    | 项目源码 | 文件源码
def __init__(self, idf_path=None):
        self.tokenizer = jieba.dt
        self.postokenizer = jieba.posseg.dt
        self.stop_words = self.STOP_WORDS.copy()
        self.idf_loader = IDFLoader(idf_path or DEFAULT_IDF)
        self.idf_freq, self.median_idf = self.idf_loader.get_idf()
项目:http_server    作者:chenguolin    | 项目源码 | 文件源码
def _lcut_internal(s):
    return dt._lcut_internal(s)
项目:http_server    作者:chenguolin    | 项目源码 | 文件源码
def _lcut_internal_no_hmm(s):
    return dt._lcut_internal_no_hmm(s)
项目:http_server    作者:chenguolin    | 项目源码 | 文件源码
def __init__(self, idf_path=None):
        self.tokenizer = jieba.dt
        self.postokenizer = jieba.posseg.dt
        self.stop_words = self.STOP_WORDS.copy()
        self.idf_loader = IDFLoader(idf_path or DEFAULT_IDF)
        self.idf_freq, self.median_idf = self.idf_loader.get_idf()
项目:http_server    作者:chenguolin    | 项目源码 | 文件源码
def _lcut_internal(s):
    return dt._lcut_internal(s)
项目:http_server    作者:chenguolin    | 项目源码 | 文件源码
def __init__(self, idf_path=None):
        self.tokenizer = jieba.dt
        self.postokenizer = jieba.posseg.dt
        self.stop_words = self.STOP_WORDS.copy()
        self.idf_loader = IDFLoader(idf_path or DEFAULT_IDF)
        self.idf_freq, self.median_idf = self.idf_loader.get_idf()