net.sf.eos.entity
Class SimpleLongestMatchDictionaryBasedEntityRecognizer
java.lang.Object
net.sf.eos.analyzer.TokenFilter
net.sf.eos.entity.AbstractDictionaryBasedEntityRecognizer
net.sf.eos.entity.SimpleLongestMatchDictionaryBasedEntityRecognizer
- All Implemented Interfaces:
- Tokenizer, Configurable, DictionaryBasedEntityRecognizer, EntityRecognizer
public class SimpleLongestMatchDictionaryBasedEntityRecognizer
- extends AbstractDictionaryBasedEntityRecognizer
A simple matcher for named entities. The implementation slices
Tokens
of a defined maximum length thru the recognizer.
If a token combination matches a key in the
entity map
,
a new Token
of type EntityRecognizer.ENTITY_TYPE
is created and return by next()
.
- Author:
- Sascha Kohlmann
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleLongestMatchDictionaryBasedEntityRecognizer
public SimpleLongestMatchDictionaryBasedEntityRecognizer(Tokenizer source)
- Creates a new instance.
- Parameters:
source
- the source tokenizer
next
public Token next()
throws TokenizerException
- Returned
Token
may be of type
EntityRecognizer.ENTITY_TYPE
or any different type.
- Specified by:
next
in interface Tokenizer
- Specified by:
next
in class TokenFilter
- Returns:
- the next token or
null
- Throws:
IllegalStateException
- if AbstractDictionaryBasedEntityRecognizer.getEntityMap()
returns
null
TokenizerException
- if an error occurs- See Also:
Tokenizer.next()
Copyright © 2008. All Rights Reserved.