Package opennlp.tools.namefind
Class BioCodec
- java.lang.Object
-
- opennlp.tools.namefind.BioCodec
-
- All Implemented Interfaces:
SequenceCodec<String>
public class BioCodec extends Object implements SequenceCodec<String>
The defaultSequenceCodecimplementation according to theBIOscheme:- 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:
SequenceCodec,BilouCodec
-
-
Constructor Summary
Constructors Constructor Description BioCodec()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanareOutcomesCompatible(String[] outcomes)Checks if theoutcomesof a model are compatible with thisSequenceCodec.NameFinderSequenceValidatorcreateSequenceValidator()Span[]decode(List<String> c)String[]encode(Span[] names, int length)
-
-
-
Field Detail
-
START
public static final String START
- See Also:
- Constant Field Values
-
CONTINUE
public static final String CONTINUE
- See Also:
- Constant Field Values
-
OTHER
public static final String OTHER
- See Also:
- Constant Field Values
-
-
Method Detail
-
decode
public Span[] decode(List<String> c)
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
public String[] encode(Span[] names, int length)
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
public NameFinderSequenceValidator createSequenceValidator()
- Specified by:
createSequenceValidatorin interfaceSequenceCodec<String>- Returns:
- A
SequenceValidatorwhich can validate a sequence ofoutcomes.
-
areOutcomesCompatible
public boolean areOutcomesCompatible(String[] outcomes)
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.
-
-