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.-
Method Summary
Modifier and TypeMethodDescriptionboolean
areOutcomesCompatible
(String[] outcomes) Checks if theoutcomes
of a model are compatible with thisSequenceCodec
.Span[]
T[]
-
Method Details
-
decode
- Parameters:
c
- A list ofSequenceCodec
to decode.- Returns:
- A
Span
array encapsulating the decoded elements inc
.
-
encode
- Parameters:
names
- A list ofelements
to encode.length
- The length to respect.- Returns:
- An array of
SequenceCodec
to encode.
-
createSequenceValidator
SequenceValidator<T> createSequenceValidator()- Returns:
- A
SequenceValidator
which can validate a sequence ofoutcomes
.
-
areOutcomesCompatible
Checks if theoutcomes
of a model are compatible with thisSequenceCodec
.- Parameters:
outcomes
- The possible model outcomes.- Returns:
true
ifoutcomes
are type compatible,false
otherwise.
-