Class HHMMSegmenter


  • public class HHMMSegmenter
    extends java.lang.Object
    Finds the optimal segmentation of a sentence into Chinese words
    • Constructor Summary

      Constructors 
      Constructor Description
      HHMMSegmenter()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private SegGraph createSegGraph​(java.lang.String sentence)
      Create the SegGraph for a sentence.
      private static int[] getCharTypes​(java.lang.String sentence)
      Get the character types for every character in a sentence.
      java.util.List<SegToken> process​(java.lang.String sentence)
      Return a list of SegToken representing the best segmentation of a sentence
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • HHMMSegmenter

        public HHMMSegmenter()
    • Method Detail

      • createSegGraph

        private SegGraph createSegGraph​(java.lang.String sentence)
        Create the SegGraph for a sentence.
        Parameters:
        sentence - input sentence, without start and end markers
        Returns:
        SegGraph corresponding to the input sentence.
      • getCharTypes

        private static int[] getCharTypes​(java.lang.String sentence)
        Get the character types for every character in a sentence.
        Parameters:
        sentence - input sentence
        Returns:
        array of character types corresponding to character positions in the sentence
        See Also:
        Utility.getCharType(char)
      • process

        public java.util.List<SegToken> process​(java.lang.String sentence)
        Return a list of SegToken representing the best segmentation of a sentence
        Parameters:
        sentence - input sentence
        Returns:
        best segmentation as a List