Class ManualSynthesizer


  • public final class ManualSynthesizer
    extends java.lang.Object
    A synthesizer that reads the inflected form and 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 synthesizer *.dict file.

    File Format: fullform baseform postags (tab separated)

    See Also:
    ManualTagger, BaseSynthesizer
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Map<java.lang.String,​java.util.List<java.lang.String>> mapping
      a map with the key composed by the lemma and POS (separated by "|").
      private java.util.Set<java.lang.String> possibleTags  
    • Constructor Summary

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

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.Set<java.lang.String> getPossibleTags()
      Retrieve all the possible POS values.
      private ManualSynthesizer.MappingAndTags loadMapping​(java.io.InputStream inputStream, java.lang.String encoding)  
      java.util.List<java.lang.String> lookup​(java.lang.String lemma, java.lang.String posTag)
      Look up a word's inflected form as specified by the lemma and POS tag.
      • 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<java.lang.String>> mapping
        a map with the key composed by the lemma and POS (separated by "|"). The values are lists of inflected forms.
      • possibleTags

        private final java.util.Set<java.lang.String> possibleTags
    • Constructor Detail

      • ManualSynthesizer

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

      • getPossibleTags

        public java.util.Set<java.lang.String> getPossibleTags()
        Retrieve all the possible POS values.
      • lookup

        public java.util.List<java.lang.String> lookup​(java.lang.String lemma,
                                                       java.lang.String posTag)
        Look up a word's inflected form as specified by the lemma and POS tag.
        Parameters:
        lemma - the lemma to inflect.
        posTag - the required POS tag.
        Returns:
        a list with all the inflected forms of the specified lemma having the specified POS tag. If no inflected form is found, the function returns null.
      • loadMapping

        private ManualSynthesizer.MappingAndTags loadMapping​(java.io.InputStream inputStream,
                                                             java.lang.String encoding)
                                                      throws java.io.IOException
        Throws:
        java.io.IOException