Class DemoTagger

  • All Implemented Interfaces:
    Tagger

    public class DemoTagger
    extends java.lang.Object
    implements Tagger
    A trivial tagger that does nothing than assign null tags to words.
    • Constructor Summary

      Constructors 
      Constructor Description
      DemoTagger()  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      AnalyzedTokenReadings createNullToken​(java.lang.String token, int startPos)
      Create the AnalyzedToken used for whitespace and other non-words.
      AnalyzedToken createToken​(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 of AnalyzedTokens that assigns each term in the sentence some kind of part-of-speech information (not necessarily just one tag).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • DemoTagger

        public DemoTagger()
    • Method Detail

      • tag

        public java.util.List<AnalyzedTokenReadings> tag​(java.util.List<java.lang.String> sentenceTokens)
        Description copied from interface: Tagger
        Returns a list of AnalyzedTokens 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.

        Specified by:
        tag in interface Tagger
        Parameters:
        sentenceTokens - the text as returned by a WordTokenizer
      • createNullToken

        public AnalyzedTokenReadings createNullToken​(java.lang.String token,
                                                     int startPos)
        Description copied from interface: Tagger
        Create the AnalyzedToken used for whitespace and other non-words. Use null as the POS tag for this token.
        Specified by:
        createNullToken in interface Tagger
      • createToken

        public AnalyzedToken createToken​(java.lang.String token,
                                         java.lang.String posTag)
        Description copied from interface: Tagger
        Create a token specific to the language of the implementing class.
        Specified by:
        createToken in interface Tagger