Class CombiningTagger

java.lang.Object
org.languagetool.tagging.CombiningTagger
All Implemented Interfaces:
WordTagger

public class CombiningTagger extends Object implements WordTagger
Tags a word using two taggers, combining their results.
Since:
2.8
  • Field Details

    • tagger1

      private final WordTagger tagger1
    • tagger2

      private final WordTagger tagger2
    • removalTagger

      private final WordTagger removalTagger
    • overwriteWithSecondTagger

      private final boolean overwriteWithSecondTagger
  • Constructor Details

    • 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 file
      tagger2 - typically the tagger that takes its data from the plain text file added.txt
      removalTagger - the tagger that removes readings which takes its data from the plain text file removed.txt, or null
      overwriteWithSecondTagger - if set to true, only the second tagger's result will be used if both first and second tagger can tag that word
      Since:
      3.2
  • Method Details

    • tag

      public List<TaggedWord> tag(String word)
      Specified by:
      tag in interface WordTagger
      Parameters:
      word - the word to be tagged
      Returns:
      the possible POS tags, or an empty list