# pycantonese.word_segmentation.Segmenter

class pycantonese.word_segmentation.Segmenter(*, max_word_length=5, allow=None, disallow=None)

  A customizable word segmentation model.

  New in version 3.0.0.

  Methods

  `fit`(sents) | Train the model with the input segmented sentences.
  `predict`(sent_strs) | Segment the given unsegmented sentences.

  __init__(*, max_word_length=5, allow=None, disallow=None)

    Initialize a Segmenter object.

    Parameters
      max_word_length int, optional

        Maximum word length this model allows.

      allow iterable[str], optional

        Words to allow in word segmentation.

      disallow iterable[str], optional

        Words to disallow in word segmentation.

  Methods

  `__init__`(*[, max_word_length, allow, disallow]) | Initialize a Segmenter object.
  `fit`(sents) | Train the model with the input segmented sentences.
  `predict`(sent_strs) | Segment the given unsegmented sentences.