Class PosTaggerDriver


  • public class PosTaggerDriver
    extends Object
    Driver for the Part of Speech tagger. Use this to tag all sentences in a given file with part of speech tags
    Author:
    shashank
    • Constructor Detail

      • PosTaggerDriver

        public PosTaggerDriver()
    • Method Detail

      • getTaggedSentence

        public static String getTaggedSentence​(String grammerFile,
                                               String sentenceToTag,
                                               boolean isTokenized)
        Gets the equivalent POS sentence for the given sentenceToTag
        Parameters:
        grammerFile - file containing POS model
        sentenceToTag - sentence for which POS tags will be returned
        is -
        Returns:
        a string where the words from sentenceToTag are replaced with corresponding part of speech tags
      • main

        public static void main​(String[] args)
        Parameters:
        args - 0 - file containing the part of speech model 1 - input file 2 - output file 3 - (boolean) does the input file contain annotated sentence (true) or not (false)