java.lang.Object
org.miaixz.bus.core.center.iterator.ComputeIterator<NLPWord>
org.miaixz.bus.extra.nlp.AbstractResult
org.miaixz.bus.extra.nlp.provider.mmseg.MmsegResult
- All Implemented Interfaces:
Iterable<NLPWord>,Iterator<NLPWord>,org.miaixz.bus.core.center.iterator.IterableIterator<NLPWord>,NLPResult
mmseg4j word segmentation result implementation. This class adapts the mmseg4j
MMSeg result to the common
NLPResult interface. Project homepage:
https://github.com/chenlb/mmseg4j-core- Since:
- Java 17+
- Author:
- Kimi Liu
-
Constructor Summary
ConstructorsConstructorDescriptionMmsegResult(com.chenlb.mmseg4j.MMSeg mmSeg) Constructs aMmsegResultinstance by wrapping an mmseg4j segmentation result. -
Method Summary
Methods inherited from class org.miaixz.bus.extra.nlp.AbstractResult
computeNextMethods 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
-
MmsegResult
public MmsegResult(com.chenlb.mmseg4j.MMSeg mmSeg) Constructs aMmsegResultinstance by wrapping an mmseg4j segmentation result.- Parameters:
mmSeg- TheMMSegobject obtained from mmseg4j word segmentation.
-
-
Method Details
-
nextWord
Retrieves the next word from the mmseg4j segmentation result. This method calls thenext()method of the underlyingMMSegand wraps the resultingWordin aMmsegWord.- Specified by:
nextWordin classAbstractResult- Returns:
- The next
NLPWordin the sequence, ornullif the iteration has no more elements. - Throws:
org.miaixz.bus.core.lang.exception.InternalException- if anIOExceptionoccurs during the operation.
-