Package opennlp.tools.namefind
Class BioCodec
java.lang.Object
opennlp.tools.namefind.BioCodec
- All Implemented Interfaces:
SequenceCodec<String>
The default
SequenceCodec implementation according to the BIO scheme:
- B: 'beginning' of a NE
- I: 'inside', the word is inside a NE
- O: 'outside', the word is a regular word outside a NE
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanareOutcomesCompatible(String[] outcomes) Checks if theoutcomesof a model are compatible with thisSequenceCodec.Span[]String[]
-
Field Details
-
START
- See Also:
-
CONTINUE
- See Also:
-
OTHER
- See Also:
-
-
Constructor Details
-
BioCodec
public BioCodec()
-
-
Method Details
-
decode
Description copied from interface:SequenceCodec- Specified by:
decodein interfaceSequenceCodec<String>- Parameters:
c- A list ofSequenceCodecto decode.- Returns:
- A
Spanarray encapsulating the decoded elements inc.
-
encode
Description copied from interface:SequenceCodec- Specified by:
encodein interfaceSequenceCodec<String>- Parameters:
names- A list ofelementsto encode.length- The length to respect.- Returns:
- An array of
SequenceCodecto encode.
-
createSequenceValidator
- Specified by:
createSequenceValidatorin interfaceSequenceCodec<String>- Returns:
- A
SequenceValidatorwhich can validate a sequence ofoutcomes.
-
areOutcomesCompatible
Description copied from interface:SequenceCodecChecks if theoutcomesof a model are compatible with thisSequenceCodec.- Specified by:
areOutcomesCompatiblein interfaceSequenceCodec<String>- Parameters:
outcomes- The possible model outcomes.- Returns:
trueifoutcomesare type compatible,falseotherwise.
-