java.lang.Object
org.miaixz.bus.extra.nlp.provider.ansj.AnsjResult
- All Implemented Interfaces:
Iterable<NLPWord>,Iterator<NLPWord>,org.miaixz.bus.core.center.iterator.IterableIterator<NLPWord>,NLPResult
Implementation of
NLPResult for Ansj word segmentation results. This class wraps the
Result from Ansj and provides an iterator over NLPWord objects, adapting Ansj's
Term to the common interface. Project homepage:
https://github.com/NLPchina/ansj_seg- Since:
- Java 17+
- Author:
- Kimi Liu
-
Constructor Summary
ConstructorsConstructorDescriptionAnsjResult(org.ansj.domain.Result ansjResult) Constructs anAnsjResultinstance by wrapping an Ansj segmentation result. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface org.miaixz.bus.core.center.iterator.IterableIterator
iteratorMethods inherited from interface java.util.Iterator
forEachRemaining
-
Constructor Details
-
AnsjResult
public AnsjResult(org.ansj.domain.Result ansjResult) Constructs anAnsjResultinstance by wrapping an Ansj segmentation result.- Parameters:
ansjResult- TheResultobject obtained from Ansj word segmentation.
-
-
Method Details
-
hasNext
public boolean hasNext()Checks if there are more words in the segmentation result. -
next
-
remove
public void remove()Removes the last word returned by this iterator from the underlying collection. This operation is optional and may throw anUnsupportedOperationException.
-