Package org.languagetool.tagging
Class CombiningTagger
- java.lang.Object
-
- org.languagetool.tagging.CombiningTagger
-
- All Implemented Interfaces:
WordTagger
public class CombiningTagger extends java.lang.Object implements WordTagger
Tags a word using two taggers, combining their results.- Since:
- 2.8
-
-
Field Summary
Fields Modifier and Type Field Description private boolean
overwriteWithSecondTagger
private WordTagger
removalTagger
private WordTagger
tagger1
private WordTagger
tagger2
-
Constructor Summary
Constructors Constructor Description CombiningTagger(WordTagger tagger1, WordTagger tagger2, boolean overwriteWithSecondTagger)
CombiningTagger(WordTagger tagger1, WordTagger tagger2, WordTagger removalTagger, boolean overwriteWithSecondTagger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<TaggedWord>
tag(java.lang.String word)
-
-
-
Field Detail
-
tagger1
private final WordTagger tagger1
-
tagger2
private final WordTagger tagger2
-
removalTagger
private final WordTagger removalTagger
-
overwriteWithSecondTagger
private final boolean overwriteWithSecondTagger
-
-
Constructor Detail
-
CombiningTagger
public CombiningTagger(WordTagger tagger1, WordTagger tagger2, boolean overwriteWithSecondTagger)
-
CombiningTagger
public CombiningTagger(WordTagger tagger1, WordTagger tagger2, WordTagger removalTagger, boolean overwriteWithSecondTagger)
- Parameters:
tagger1
- typically the tagger that takes its data from the binary filetagger2
- typically the tagger that takes its data from the plain text fileadded.txt
removalTagger
- the tagger that removes readings which takes its data from the plain text fileremoved.txt
, ornull
overwriteWithSecondTagger
- if set totrue
, only the second tagger's result will be used if both first and second tagger can tag that word- Since:
- 3.2
-
-
Method Detail
-
tag
public java.util.List<TaggedWord> tag(java.lang.String word)
- Specified by:
tag
in interfaceWordTagger
- Parameters:
word
- the word to be tagged- Returns:
- the possible POS tags, or an empty list
-
-