Package opennlp.tools.util
Interface SequenceCodec<T>
- Type Parameters:
T- The generic type for the elements to handle.
- All Known Implementing Classes:
BilouCodec,BioCodec
public interface SequenceCodec<T>
A codec for sequences of type
SequenceCodec.
Defines methods to en- or decode, and validate.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionbooleanareOutcomesCompatible(String[] outcomes) Checks if theoutcomesof a model are compatible with thisSequenceCodec.Span[]T[]
-
Field Details
-
DEFAULT_PREFIX
- See Also:
-
-
Method Details
-
decode
- Parameters:
c- A list ofSequenceCodecto decode.- Returns:
- A
Spanarray encapsulating the decoded elements inc.
-
encode
- Parameters:
names- A list ofelementsto encode.length- The length to respect.- Returns:
- An array of
SequenceCodecto encode.
-
createSequenceValidator
SequenceValidator<T> createSequenceValidator()- Returns:
- A
SequenceValidatorwhich can validate a sequence ofoutcomes.
-
areOutcomesCompatible
Checks if theoutcomesof a model are compatible with thisSequenceCodec.- Parameters:
outcomes- The possible model outcomes.- Returns:
trueifoutcomesare type compatible,falseotherwise.
-