ckip_classic.ws module¶
- class ckip_classic.ws.CkipWs(*, logger=False, ini_file=None, lex_list=None, **kwargs)[source]¶
Bases:
object
The CKIP word segmentation driver.
- Parameters
logger (bool) – enable logger.
lex_list (Iterable) – passed to
ckip_classic.ini.create_ws_lex()
overridden lex_file forckip_classic.ini.create_ws_ini()
.ini_file (str) – the path to the INI file.
** – the configs for CKIPWS, passed to
ckip_classic.ini.create_ws_ini()
, ignored if ini_file is set.
Danger
Never instance more than one object of this class!
- apply(text)[source]¶
Parse a sentence.
- Parameters
text (str) – the input sentence.
- Returns
str – the output sentence.
Hint
One may also call this method as
__call__()
.