Package org.lionsoul.jcseg.segmenter
Class DelimiterSeg
- java.lang.Object
-
- org.lionsoul.jcseg.segmenter.DelimiterSeg
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.lionsoul.jcseg.ISegment
ISegment.Type
-
-
Field Summary
Fields Modifier and Type Field Description SegmenterConfigconfigADictionarydicthe dictionary and task configurationprotected LinkedList<IWord>wordPool-
Fields inherited from interface org.lionsoul.jcseg.ISegment
CHECK_CE_MASk, CHECK_CF_MASK, CHECK_EC_MASK, COMPLEX, COMPLEX_MODE, DELIMITER, DELIMITER_MODE, DETECT, DETECT_MODE, MOST, MOST_MODE, NGRAM, NGRAM_MODE, NLP, NLP_MODE, SIMPLE, SIMPLE_MODE, START_SS_MASK
-
-
Constructor Summary
Constructors Constructor Description DelimiterSeg(SegmenterConfig config, ADictionary dic)method to create a new ISegment
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SegmenterConfiggetConfig()get the current Segmenter Config instancechargetDelimiter()get the current delimiterADictionarygetDic()get the current dictionary instanceintgetStreamPosition()get the current length of the streamIWordnext()segment a word from a char array from a specified position.protected voidpushBack(int data)push back the data to the streamprotected intreadNext()read the next char from the current positionvoidreset(Reader input)reset the readervoidsetDelimiter(char delimiter)set the delimiter default to whitespace
-
-
-
Field Detail
-
wordPool
protected final LinkedList<IWord> wordPool
-
dic
public final ADictionary dic
the dictionary and task configuration
-
config
public final SegmenterConfig config
-
-
Constructor Detail
-
DelimiterSeg
public DelimiterSeg(SegmenterConfig config, ADictionary dic)
method to create a new ISegment- Parameters:
config-dic-
-
-
Method Detail
-
reset
public void reset(Reader input) throws IOException
Description copied from interface:ISegmentreset the reader- Specified by:
resetin interfaceISegment- Throws:
IOException
-
getStreamPosition
public int getStreamPosition()
Description copied from interface:ISegmentget the current length of the stream- Specified by:
getStreamPositionin interfaceISegment
-
readNext
protected int readNext() throws IOExceptionread 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-
-
next
public IWord next() throws IOException
Description copied from interface:ISegmentsegment a word from a char array from a specified position.- Specified by:
nextin interfaceISegment- Throws:
IOException
-
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
-
-