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 boolean
areOutcomesCompatible(String[] outcomes)
Checks if theoutcomes
of 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 ofSequenceCodec
to decode.- Returns:
- A
Span
array encapsulating the decoded elements inc
.
-
encode
T[] encode(Span[] names, int length)
- 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
boolean areOutcomesCompatible(String[] outcomes)
Checks if theoutcomes
of a model are compatible with thisSequenceCodec
.- Parameters:
outcomes
- The possible model outcomes.- Returns:
true
ifoutcomes
are type compatible,false
otherwise.
-
-