java.lang.Object
org.miaixz.bus.extra.nlp.provider.jieba.JiebaProvider
- All Implemented Interfaces:
Serializable,org.miaixz.bus.core.Provider,NLPProvider
Jieba word segmentation engine implementation. This class serves as a concrete
NLPProvider for the Jieba NLP
library, adapting its word segmentation capabilities to the common NLP interface. The underlying
JiebaSegmenter.process(String, SegMode) method is thread-safe. Project homepage:
https://github.com/huaban/jieba-analysis- Since:
- Java 17+
- Author:
- Kimi Liu
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newJiebaProviderinstance with the default segmentation mode, which isJiebaSegmenter.SegMode.SEARCH.JiebaProvider(com.huaban.analysis.jieba.JiebaSegmenter.SegMode mode) Constructs a newJiebaProviderinstance with a specified segmentation mode. -
Method Summary
Modifier and TypeMethodDescriptionparse(CharSequence text) Performs word segmentation on the given text using the configured JiebaJiebaSegmenterinstance.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.miaixz.bus.extra.nlp.NLPProvider
type
-
Constructor Details
-
JiebaProvider
public JiebaProvider()Constructs a newJiebaProviderinstance with the default segmentation mode, which isJiebaSegmenter.SegMode.SEARCH. -
JiebaProvider
public JiebaProvider(com.huaban.analysis.jieba.JiebaSegmenter.SegMode mode) Constructs a newJiebaProviderinstance with a specified segmentation mode.- Parameters:
mode- TheJiebaSegmenter.SegModeto use for word segmentation (e.g.,JiebaSegmenter.SegMode.SEARCHorJiebaSegmenter.SegMode.INDEX).
-
-
Method Details
-
parse
Performs word segmentation on the given text using the configured JiebaJiebaSegmenterinstance. The result is wrapped in aJiebaResultto conform to theNLPResultinterface.- Specified by:
parsein interfaceNLPProvider- Parameters:
text- The input textCharSequenceto be segmented.- Returns:
- An
NLPResultobject containing the segmented words from Jieba.
-