public class UnigramTagger extends AbstractPartOfSpeechTagger implements PartOfSpeechTagger, CanTagOneWord
The unigram part of speech tagger uses a lexicon to assign the most frequently occurring part of speech tag to a spelling.
contextRules, contextualSmoother, dynamicLexicon, lexicalRules, lexicalSmoother, lexicon, logger, partOfSpeechGuesser, postTokenizer, retagger, ruleCorrections, transitionMatrix
Constructor and Description |
---|
UnigramTagger()
Create a unigram tagger.
|
Modifier and Type | Method and Description |
---|---|
<T extends AdornedWord> |
tagAdornedWordList(java.util.List<T> sentence)
Tag an adorned word list.
|
java.lang.String |
tagWord(AdornedWord word)
Tag a single word.
|
java.lang.String |
tagWord(java.lang.String word)
Tag a single word.
|
java.lang.String |
toString()
Return tagger description.
|
clearRuleCorrections, createPartOfSpeechGuesser, getContextualSmoother, getDynamicLexicon, getLexicalSmoother, getLexicon, getLexicon, getLogger, getMostCommonTag, getPartOfSpeechGuesser, getPostTokenizer, getRetagger, getRuleCorrections, getTagCount, getTagsForWord, getTransitionMatrix, incrementRuleCorrections, retagWords, setContextRules, setContextualSmoother, setLexicalRules, setLexicalSmoother, setLexicon, setLogger, setPartOfSpeechGuesser, setPostTokenizer, setRetagger, setTransitionMatrix, tagAdornedWordSentence, tagAdornedWordSentences, tagSentence, tagSentences, usesContextRules, usesLexicalRules, usesTransitionProbabilities
close
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
clearRuleCorrections, getContextualSmoother, getLexicalSmoother, getLexicon, getLexicon, getPartOfSpeechGuesser, getPostTokenizer, getRetagger, getRuleCorrections, getTagCount, getTagsForWord, getTransitionMatrix, incrementRuleCorrections, retagWords, setContextRules, setContextualSmoother, setLexicalRules, setLexicalSmoother, setLexicon, setPartOfSpeechGuesser, setPostTokenizer, setRetagger, setTransitionMatrix, tagAdornedWordSentence, tagAdornedWordSentences, tagSentence, tagSentences, usesContextRules, usesLexicalRules, usesTransitionProbabilities
close
public <T extends AdornedWord> java.util.List<T> tagAdornedWordList(java.util.List<T> sentence)
tagAdornedWordList
in interface PartOfSpeechTagger
tagAdornedWordList
in class AbstractPartOfSpeechTagger
sentence
- The sentence as a list of adorned words.AdornedWord
of the words in the sentence tagged with
parts of speech.
The input sentence is a
AdornedWord
of words to tag. The output is the same list
with parts of speech added.
public java.lang.String tagWord(java.lang.String word)
tagWord
in interface CanTagOneWord
word
- The word.Returns most common tag for word.
public java.lang.String tagWord(AdornedWord word)
tagWord
in interface CanTagOneWord
word
- The word as an AdornedWord.Returns most common tag for word.
public java.lang.String toString()
toString
in class java.lang.Object