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