Class ManualSynthesizer

java.lang.Object
org.languagetool.synthesis.ManualSynthesizer

public final class ManualSynthesizer extends 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:
  • Field Details

  • Constructor Details

  • Method Details

    • groupByHash

      private static it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap<List<org.apache.commons.lang3.tuple.Triple<String,String,String>>> groupByHash(Map<TaggedWord,List<String>> mapping)
    • encodeForm

      private static String encodeForm(String lemma, String word)
    • decodeForm

      private static String decodeForm(String lemma, String word)
    • collectTags

      private static it.unimi.dsi.fastutil.objects.ObjectOpenHashSet<String> collectTags(Map<TaggedWord,List<String>> mapping)
    • hashCode

      private static int hashCode(String lemma, String posTag)
    • getPossibleTags

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

      @Nullable public List<String> lookup(String lemma, 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 static Map<TaggedWord,List<String>> loadMapping(InputStream inputStream) throws IOException
      Throws:
      IOException