Package org.languagetool.tagging
Interface Tagger
-
- All Known Implementing Classes:
BaseTagger,DemoTagger
public interface TaggerThe part-of-speech tagger interface, whose implementations are usually language-dependent.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description AnalyzedTokenReadingscreateNullToken(java.lang.String token, int startPos)Create the AnalyzedToken used for whitespace and other non-words.AnalyzedTokencreateToken(java.lang.String token, java.lang.String posTag)Create a token specific to the language of the implementing class.java.util.List<AnalyzedTokenReadings>tag(java.util.List<java.lang.String> sentenceTokens)Returns a list ofAnalyzedTokens that assigns each term in the sentence some kind of part-of-speech information (not necessarily just one tag).
-
-
-
Method Detail
-
tag
java.util.List<AnalyzedTokenReadings> tag(java.util.List<java.lang.String> sentenceTokens) throws java.io.IOException
Returns a list ofAnalyzedTokens that assigns each term in the sentence some kind of part-of-speech information (not necessarily just one tag).Note that this method takes exactly one sentence. Its implementation may implement special cases for the first word of a sentence, which is usually written with an uppercase letter.
- Parameters:
sentenceTokens- the text as returned by a WordTokenizer- Throws:
java.io.IOException
-
createNullToken
AnalyzedTokenReadings createNullToken(java.lang.String token, int startPos)
Create the AnalyzedToken used for whitespace and other non-words. Usenullas the POS tag for this token.
-
createToken
AnalyzedToken createToken(java.lang.String token, java.lang.String posTag)
Create a token specific to the language of the implementing class.
-
-