ckipnlp.parser package

class ckipnlp.parser.CkipParser(*, logger=False, inifile=None, wsinifile=None, **options)[source]

Bases: object

The CKIP sentence parsing driver.

Parameters:
apply(text)[source]

Segment a sentence.

Parameters:text (str) – the input sentence.
Returns:str – the output sentence.

Notes

One may also call this method as __call__().

apply_list(ilist)[source]

Segment a list of sentences.

Parameters:ilist (list) – the list of input sentences (str).
Returns:olist (list) – the list of output sentences (str).
apply_file(ifile, ofile)[source]

Segment a file.

Parameters:
  • ifile (str) – the input file.
  • ofile (str) – the output file (will be overwritten).