- All Superinterfaces:
org.miaixz.bus.core.Provider,Serializable
- All Known Implementing Classes:
AnalysisProvider,AnsjProvider,HanLPProvider,JcsegProvider,JiebaProvider,MmsegProvider,MynlpProvider,SmartcnProvider,WordProvider
public interface NLPProvider
extends org.miaixz.bus.core.Provider
Interface definition for Natural Language Processing (NLP) word segmentation engines. Users implement this interface
to adapt specific word segmentation engines, such as Ansj, HanLP, etc. Since the engine typically uses a singleton
pattern, implementations are required to be thread-safe to handle concurrent requests for word segmentation.
- Since:
- Java 17+
- Author:
- Kimi Liu
-
Method Summary
Modifier and TypeMethodDescriptionparse(CharSequence text) Performs word segmentation on the given text and returns the result.default Objecttype()Returns the type of this NLP provider.
-
Method Details
-
parse
Performs word segmentation on the given text and returns the result. Implementations should process the input text and produce a structured result containing the segmented words.- Parameters:
text- The input textCharSequenceto be segmented.- Returns:
- An
NLPResultimplementation containing the segmented words.
-
type
Returns the type of this NLP provider. By default, it returnsEnumValue.Povider.NLP.- Specified by:
typein interfaceorg.miaixz.bus.core.Provider- Returns:
- The type of the provider, typically
EnumValue.Povider.NLP.
-