ckipnlp.parser package¶
-
class
ckipnlp.parser.
CkipParser
(*, logger=False, inifile=None, wsinifile=None, **kwargs)[source]¶ Bases:
object
The CKIP sentence parsing driver.
Parameters: - logger (bool) – enable logger.
- inifile (str) – the path to the INI file.
- wsinifile (str) – the path to the INI file for CKIPWS.
Other Parameters: - ** – the configs for CKIPParser, ignored if inifile is set. Please refer
ckipnlp.util.ini.create_parser_ini()
. - ** – the configs for CKIPWS, ignored if wsinifile is set. Please refer
ckipnlp.util.ini.create_ws_ini()
.
Danger
Never instance more than one object of this class!
-
apply
(text)[source]¶ Segment a sentence.
Parameters: text (str) – the input sentence. Returns: str – the output sentence. Hint
One may also call this method as
__call__()
.