java.lang.Object
org.miaixz.bus.core.center.iterator.ComputeIterator<NLPWord>
org.miaixz.bus.extra.nlp.AbstractResult
- All Implemented Interfaces:
Iterable<NLPWord>,Iterator<NLPWord>,org.miaixz.bus.core.center.iterator.IterableIterator<NLPWord>,NLPResult
- Direct Known Subclasses:
AnalysisResult,JcsegResult,MmsegResult
public abstract class AbstractResult
extends org.miaixz.bus.core.center.iterator.ComputeIterator<NLPWord>
implements NLPResult
Abstract base class that decorates a regular result class (one that does not inherently implement
Iterator)
as an NLPResult. This class simplifies the implementation of NLPResult by requiring subclasses to
only implement the nextWord() method to provide the next segmented word.- Since:
- Java 17+
- Author:
- Kimi Liu
-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class org.miaixz.bus.core.center.iterator.ComputeIterator
finish, hasNext, nextMethods 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, hasNext, next, remove
-
Constructor Details
-
AbstractResult
public AbstractResult()
-
-
Method Details
-
nextWord
Retrieves the next word from the word segmentation result. This method should be implemented by subclasses to provide the logic for fetching the nextNLPWord. Returnsnullwhen there are no more words to be processed.- Returns:
- The next
NLPWordin the sequence, ornullif the iteration has no more elements.
-
computeNext
Computes the next element in the iteration. This method is called byComputeIteratorto get the next word. It delegates to the abstractnextWord()method.
-