Class DelimiterSeg

  • All Implemented Interfaces:
    ISegment

    public class DelimiterSeg
    extends Object
    implements ISegment
    delimiter segment algorithm implementation extended from common segment interface ISegment
    Author:
    chenxin
    • Constructor Detail

      • DelimiterSeg

        public DelimiterSeg​(SegmenterConfig config,
                            ADictionary dic)
        method to create a new ISegment
        Parameters:
        config -
        dic -
    • Method Detail

      • getStreamPosition

        public int getStreamPosition()
        Description copied from interface: ISegment
        get the current length of the stream
        Specified by:
        getStreamPosition in interface ISegment
      • readNext

        protected int readNext()
                        throws IOException
        read the next char from the current position
        Returns:
        int
        Throws:
        IOException
      • pushBack

        protected void pushBack​(int data)
        push back the data to the stream
        Parameters:
        data -
      • getDelimiter

        public char getDelimiter()
        get the current delimiter
        Returns:
        char
      • setDelimiter

        public void setDelimiter​(char delimiter)
        set the delimiter default to whitespace
        Parameters:
        delimiter -
      • getDic

        public ADictionary getDic()
        get the current dictionary instance
        Returns:
        ADictionary
      • getConfig

        public SegmenterConfig getConfig()
        get the current Segmenter Config instance
        Returns:
        SegmenterConfig