Class 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 Detail

      • 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 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 Detail

      • tag

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