Package opennlp.tools.namefind
Class BilouCodec
java.lang.Object
opennlp.tools.namefind.BilouCodec
- All Implemented Interfaces:
SequenceCodec<String>
The default
SequenceCodec
implementation according to the BILOU
scheme.
- B: 'beginning' of a NE
- I: 'inside', the word is inside a NE
- L: 'last', the last (I) word inside a NE
- O: 'outside', the word is a regular word outside a NE
- U: 'unit', any standalone token following words outside of NE
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
areOutcomesCompatible
(String[] outcomes) B requires CL or L, C requires BL, L requires B, O requires any valid combo/unit, U requires none.
Span[]
String[]
-
Field Details
-
START
- See Also:
-
CONTINUE
- See Also:
-
LAST
- See Also:
-
UNIT
- See Also:
-
OTHER
- See Also:
-
-
Constructor Details
-
BilouCodec
public BilouCodec()
-
-
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
B requires CL or L, C requires BL, L requires B, O requires any valid combo/unit, U requires none.
- Specified by:
areOutcomesCompatible
in interfaceSequenceCodec<String>
- Parameters:
outcomes
- All potential model outcomes check.- Returns:
true
, if model outcomes are compatible,false
otherwise.
-