(processnum=None)
Change the module's `cut` and `cut_for_search` functions to the
    parallel version.

    Note that this only works using dt, custom Tokenizer
    instances are not supported.
Change the module's `cut` and `cut_for_search` functions to the
    parallel version.
Change the module s cut and cut_for_search functions to the parallel version .
def enable_parallel(processnum=None):
    """
    Change the module's `cut` and `cut_for_search` functions to the
    parallel version.

    Note that this only works using dt, custom Tokenizer
    instances are not supported.
    """
    global pool, dt, cut, cut_for_search
    from multiprocessing import cpu_count
    if os.name == 'nt':
        raise NotImplementedError(
            "jieba: parallel mode only supports posix system")
    else:
        from multiprocessing import Pool
    dt.check_initialized()
    if processnum is None:
        processnum = cpu_count()
    pool = Pool(processnum)
    cut = _pcut
    cut_for_search = _pcut_for_search
def enable_parallel ( processnum = None ) : global pool , dt , cut , cut_for_search from multiprocessing import cpu_count if os . name == 'nt' : raise NotImplementedError ( "jieba: parallel mode only supports posix system" ) else : from multiprocessing import Pool dt . check_initialized ( ) if processnum is None : processnum = cpu_count ( ) pool = Pool ( processnum ) cut = _pcut cut_for_search = _pcut_for_search