Package opennlp.tools.namefind

# Class BilouCodec

java.lang.Object
opennlp.tools.namefind.BilouCodec

All Implemented Interfaces:
  `opennlp.tools.util.SequenceCodec<String>`

public class BilouCodec extends Object implements opennlp.tools.util.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 paper by Roth D. and Ratinov L. (2009): Design Challenges and Misconceptions in Named Entity Recognition.

See Also:
  - `SequenceCodec`
  - `BioCodec`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `CONTINUE`
  `static final String`
  `LAST`
  `static final String`
  `OTHER`
  `static final String`
  `START`
  `static final String`
  `UNIT`

  ### Fields inherited from interface opennlp.tools.util.SequenceCodec

  `DEFAULT_PREFIX`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BilouCodec()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `boolean`
  `areOutcomesCompatible(String[] outcomes)`
  `B requires CL or L, C requires BL, L requires B, O requires any valid combo/unit, U requires none.`
  `opennlp.tools.util.SequenceValidator<String>`
  `createSequenceValidator()`
  `opennlp.tools.util.Span[]`
  `decode(List<String> c)`
  `String[]`
  `encode(opennlp.tools.util.Span[] names, int length)`

  ### Methods inherited from class java.lang.Object

  `equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- ## Field Details

  - ### START

    public static final String START
    See Also:
      - Constant Field Values

  - ### CONTINUE

    public static final String CONTINUE
    See Also:
      - Constant Field Values

  - ### LAST

    public static final String LAST
    See Also:
      - Constant Field Values

  - ### UNIT

    public static final String UNIT
    See Also:
      - Constant Field Values

  - ### OTHER

    public static final String OTHER
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### BilouCodec

    public BilouCodec()

- ## Method Details

  - ### decode

    public opennlp.tools.util.Span[] decode(List<String> c)
    Specified by:
      `decode` in interface `opennlp.tools.util.SequenceCodec<String>`

  - ### encode

    public String[] encode(opennlp.tools.util.Span[] names, int length)
    Specified by:
      `encode` in interface `opennlp.tools.util.SequenceCodec<String>`

  - ### createSequenceValidator

    public opennlp.tools.util.SequenceValidator<String> createSequenceValidator()
    Specified by:
      `createSequenceValidator` in interface `opennlp.tools.util.SequenceCodec<String>`

  - ### areOutcomesCompatible

    public boolean areOutcomesCompatible(String[] outcomes)
    `B requires CL or L, C requires BL, L requires B, O requires any valid combo/unit, U requires none.`
    Specified by:
      `areOutcomesCompatible` in interface `opennlp.tools.util.SequenceCodec<String>`
    Parameters:
      `outcomes` - All potential model outcomes check.
    Returns:
      `true`, if model outcomes are compatible, `false` otherwise.