net.sf.eos.entity
Interface DictionaryBasedEntityRecognizer

All Superinterfaces:
EntityRecognizer, Tokenizer
All Known Implementing Classes:
AbstractDictionaryBasedEntityRecognizer, SimpleLongestMatchDictionaryBasedEntityRecognizer

public interface DictionaryBasedEntityRecognizer
extends EntityRecognizer

The DictionaryBasedEntityRecognizer uses a Map to recognize entities in a text. An entity is identified thru the Token.getType() EntityRecognizer.ENTITY_TYPE. The ID coming in the map is stored in the meta data with the key ENTITY_ID_KEY.

Author:
Sascha Kohlmann

Field Summary
static String ENTITY_ID_KEY
          ID meta key.
 
Fields inherited from interface net.sf.eos.entity.EntityRecognizer
ENTITY_TYPE
 
Method Summary
 Map<CharSequence,Set<CharSequence>> getEntityMap()
          Return the entity map.
 int getMaxToken()
           
 TextBuilder getTextBuilder()
          Returns a setted builder.
 void setEntityMap(Map<CharSequence,Set<CharSequence>> entities)
          Set the entity map.
 void setMaxToken(int maxToken)
           
 void setTextBuilder(TextBuilder builder)
          Sets a builder.
 
Methods inherited from interface net.sf.eos.analyzer.Tokenizer
next
 

Field Detail

ENTITY_ID_KEY

static final String ENTITY_ID_KEY
ID meta key.

Method Detail

setEntityMap

void setEntityMap(Map<CharSequence,Set<CharSequence>> entities)
Set the entity map.

Parameters:
entities - the entity map
See Also:
Trie

getEntityMap

Map<CharSequence,Set<CharSequence>> getEntityMap()
Return the entity map.

Returns:
the entity map. May be null

setTextBuilder

void setTextBuilder(TextBuilder builder)
Sets a builder. The implementation has default builder of instance TextBuilder.SPACE_BUILDER setted at construction time.

Parameters:
builder - a builder to set or null

getTextBuilder

TextBuilder getTextBuilder()
Returns a setted builder.

Returns:
a setted builder or null.

getMaxToken

int getMaxToken()
Returns:
the maxToken

setMaxToken

void setMaxToken(int maxToken)
Parameters:
maxToken - the maxToken to set
Throws:
IllegalArgumentException - if and only if token > 1


Copyright © 2008. All Rights Reserved.