Class ManualTagger

  • All Implemented Interfaces:
    WordTagger

    public class ManualTagger
    extends java.lang.Object
    implements WordTagger
    A tagger that reads the POS information from a plain (UTF-8) text file. This makes it possible for the user to edit the text file to let the system know about new words or missing readings in the *.dict file.

    File Format: fullform baseform postags (tab separated)

    See Also:
    ManualSynthesizer
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Map<java.lang.String,​java.util.List<TaggedWord>> mapping  
    • Constructor Summary

      Constructors 
      Constructor Description
      ManualTagger​(java.io.InputStream inputStream)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private java.util.Map<java.lang.String,​java.util.List<TaggedWord>> loadMapping​(java.io.InputStream inputStream, java.lang.String encoding)  
      java.util.List<TaggedWord> tag​(java.lang.String word)
      Look up a word's baseform (lemma) and POS information.
      • Methods inherited from class java.lang.Object

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

      • mapping

        private final java.util.Map<java.lang.String,​java.util.List<TaggedWord>> mapping
    • Constructor Detail

      • ManualTagger

        public ManualTagger​(java.io.InputStream inputStream)
                     throws java.io.IOException
        Throws:
        java.io.IOException
    • Method Detail

      • loadMapping

        private java.util.Map<java.lang.String,​java.util.List<TaggedWord>> loadMapping​(java.io.InputStream inputStream,
                                                                                             java.lang.String encoding)
                                                                                      throws java.io.IOException
        Throws:
        java.io.IOException
      • tag

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