Class DefaultChunkerSequenceValidator

java.lang.Object
opennlp.tools.chunker.DefaultChunkerSequenceValidator
All Implemented Interfaces:
SequenceValidator<TokenTag>

public class DefaultChunkerSequenceValidator extends Object implements SequenceValidator<TokenTag>
The default chunker SequenceValidator implementation.
  • Constructor Details

    • DefaultChunkerSequenceValidator

      public DefaultChunkerSequenceValidator()
  • Method Details

    • validSequence

      public boolean validSequence(int i, TokenTag[] sequence, String[] s, String outcome)
      Description copied from interface: SequenceValidator
      Determines whether a particular continuation of a sequence is valid. This is used to restrict invalid sequences such as those used in start/continue tag-based chunking or could be used to implement tag dictionary restrictions.
      Specified by:
      validSequence in interface SequenceValidator<TokenTag>
      Parameters:
      i - The index in the inputSequence for which the new outcome is being proposed.
      sequence - The input sequence of SequenceValidator.
      s - The outcomes so far in this sequence.
      outcome - The next proposed outcome for the outcomes sequence.
      Returns:
      true if the sequence would still be valid with the new outcome, false otherwise.