Module bus.extra

Class JcsegResult

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

public class JcsegResult extends AbstractResult
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 Details

    • JcsegResult

      public JcsegResult(org.lionsoul.jcseg.ISegment segment)
      Constructs a JcsegResult instance by wrapping a Jcseg segmentation result.
      Parameters:
      segment - The ISegment object obtained from Jcseg word segmentation.
  • Method Details

    • nextWord

      protected NLPWord nextWord()
      Retrieves the next word from the Jcseg segmentation result. This method calls the next() method of the underlying ISegment and wraps the resulting IWord in a JcsegWord.
      Specified by:
      nextWord in class AbstractResult
      Returns:
      The next NLPWord in the sequence, or null if the iteration has no more elements.
      Throws:
      org.miaixz.bus.core.lang.exception.InternalException - if an IOException occurs during the operation.