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 typeSequenceCodec. Defines methods to en- or decode, and validate.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanareOutcomesCompatible(String[] outcomes)Checks if theoutcomesof a model are compatible with thisSequenceCodec.SequenceValidator<T>createSequenceValidator()Span[]decode(List<T> c)T[]encode(Span[] names, int length)
-
-
-
Method Detail
-
decode
Span[] decode(List<T> c)
- Parameters:
c- A list ofSequenceCodecto decode.- Returns:
- A
Spanarray encapsulating the decoded elements inc.
-
encode
T[] encode(Span[] names, int length)
- 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
boolean areOutcomesCompatible(String[] outcomes)
Checks if theoutcomesof a model are compatible with thisSequenceCodec.- Parameters:
outcomes- The possible model outcomes.- Returns:
trueifoutcomesare type compatible,falseotherwise.
-
-