public abstract class AbstractNameRecognizer extends IsCloseableObject implements NameRecognizer, UsesLexicon, UsesLogger
| Modifier and Type | Field and Description |
|---|---|
protected Lexicon |
lexicon
Lexicon used by name recognizer.
|
protected Logger |
logger
Logger used for output.
|
protected Names |
names
Built-in name lists.
|
protected PartOfSpeechTagger |
partOfSpeechTagger
Part of speech tagger used to find noun phrases.
|
protected PartOfSpeechTags |
partOfSpeechTags
Part of speech tags.
|
protected SentenceSplitter |
sentenceSplitter
Sentence splitter.
|
protected WordTokenizer |
wordTokenizer
Word tokenizer.
|
| Constructor and Description |
|---|
AbstractNameRecognizer() |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Close the name recognizer.
|
abstract <T extends AdornedWord> |
findNamePositions(java.util.List<java.util.List<T>> sentences)
Returns name positions in list of adorned word sentences.
|
abstract <T extends AdornedWord> |
findNames(java.util.List<java.util.List<T>> sentences)
Returns names from list of adorned word sentences.
|
abstract java.util.Set<java.lang.String>[] |
findNames(java.lang.String text)
Returns names from text.
|
Lexicon |
getLexicon()
Get the word lexicon.
|
Logger |
getLogger()
Get the logger.
|
PartOfSpeechTagger |
getPartOfSpeechTagger()
Get part of speech tagger.
|
static <T extends AdornedWord> |
namePositionToName(java.util.List<java.util.List<T>> sentences,
NamePosition namePosition)
Get name from name position.
|
void |
setLexicon(Lexicon lexicon)
Set the lexicon.
|
void |
setLogger(Logger logger)
Set the logger.
|
void |
setPartOfSpeechTagger(PartOfSpeechTagger posTagger)
Set part of speech tagger used to find noun phrases.
|
protected Lexicon lexicon
protected PartOfSpeechTagger partOfSpeechTagger
protected WordTokenizer wordTokenizer
protected SentenceSplitter sentenceSplitter
protected PartOfSpeechTags partOfSpeechTags
protected Names names
protected Logger logger
public Logger getLogger()
getLogger in interface UsesLoggerpublic void setLogger(Logger logger)
setLogger in interface UsesLoggerlogger - The logger.public Lexicon getLexicon()
getLexicon in interface UsesLexicongetLexicon in interface NameRecognizerpublic void setLexicon(Lexicon lexicon)
setLexicon in interface UsesLexiconsetLexicon in interface NameRecognizerlexicon - Lexicon used for tagging.public PartOfSpeechTagger getPartOfSpeechTagger()
getPartOfSpeechTagger in interface NameRecognizerpublic void setPartOfSpeechTagger(PartOfSpeechTagger posTagger)
setPartOfSpeechTagger in interface NameRecognizerposTagger - The part of speech tagger.public static <T extends AdornedWord> java.lang.String namePositionToName(java.util.List<java.util.List<T>> sentences, NamePosition namePosition)
sentences - The collection of sentences.namePosition - The name position.public abstract java.util.Set<java.lang.String>[] findNames(java.lang.String text)
findNames in interface NameRecognizertext - The text from which to extract names.public abstract <T extends AdornedWord> java.util.Set<java.lang.String>[] findNames(java.util.List<java.util.List<T>> sentences)
findNames in interface NameRecognizersentences - The collection of sentences.public abstract <T extends AdornedWord> java.util.List<NamePosition>[] findNamePositions(java.util.List<java.util.List<T>> sentences)
findNamePositions in interface NameRecognizersentences - The collection of sentences.public void close()
close in class IsCloseableObject