java.lang.Object
org.miaixz.bus.extra.nlp.provider.ansj.AnsjWord
- All Implemented Interfaces:
Serializable,NLPWord
Wrapper for a word in Ansj segmentation.
- Since:
- Java 17+
- Author:
- Kimi Liu
- See Also:
-
Constructor Details
-
AnsjWord
public AnsjWord(org.ansj.domain.Term term) Constructor.- Parameters:
term- TheTermobject.
-
-
Method Details
-
getText
Gets the text of the word. -
getStartOffset
public int getStartOffset()Gets the start offset of the word in the original text.- Specified by:
getStartOffsetin interfaceNLPWord- Returns:
- The start offset.
-
getEndOffset
public int getEndOffset()Gets the end offset of the word in the original text.- Specified by:
getEndOffsetin interfaceNLPWord- Returns:
- The end offset.
-
toString
Returns the text of the word.
-