java.lang.Object
org.miaixz.bus.core.center.iterator.ComputeIterator<NLPWord>
org.miaixz.bus.extra.nlp.AbstractResult
org.miaixz.bus.extra.nlp.provider.jcseg.JcsegResult
- All Implemented Interfaces:
Iterable<NLPWord>,Iterator<NLPWord>,org.miaixz.bus.core.center.iterator.IterableIterator<NLPWord>,NLPResult
Jcseg word segmentation result wrapper. This class adapts the Jcseg
ISegment result to the common
NLPResult interface. Project homepage:
https://gitee.com/lionsoul/jcseg- Since:
- Java 17+
- Author:
- Kimi Liu
-
Constructor Summary
ConstructorsConstructorDescriptionJcsegResult(org.lionsoul.jcseg.ISegment segment) Constructs aJcsegResultinstance by wrapping a Jcseg 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
-
JcsegResult
public JcsegResult(org.lionsoul.jcseg.ISegment segment) Constructs aJcsegResultinstance by wrapping a Jcseg segmentation result.- Parameters:
segment- TheISegmentobject obtained from Jcseg word segmentation.
-
-
Method Details
-
nextWord
Retrieves the next word from the Jcseg segmentation result. This method calls thenext()method of the underlyingISegmentand wraps the resultingIWordin aJcsegWord.- 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.
-