Class MorfologikLemmatizer

java.lang.Object
opennlp.morfologik.lemmatizer.MorfologikLemmatizer
All Implemented Interfaces:
Lemmatizer

public class MorfologikLemmatizer extends Object implements Lemmatizer
A Lemmatizer implementation based on Morfologik binary dictionaries
  • Field Details

    • dictionary

      private final morfologik.stemming.Dictionary dictionary
  • Constructor Details

    • MorfologikLemmatizer

      public MorfologikLemmatizer(Path dictionaryPath) throws IOException
      Initializes a MorfologikLemmatizer and related Dictionary from the input tab separated dictionary.
      Parameters:
      dictionaryPath - The dictionary referenced via a valid, readable Path.
      Throws:
      IOException - Thrown if IO errors occurred while reading in from dictionaryPath.
    • MorfologikLemmatizer

      public MorfologikLemmatizer(morfologik.stemming.Dictionary dictionary)
      Initializes a MorfologikLemmatizer and related Dictionary from the input tab separated dictionary.
      Parameters:
      dictionary - The Dictionary to be used.
  • Method Details

    • lemmatize

      private List<String> lemmatize(String word, String postag)
    • asString

      private String asString(CharSequence tag)
    • lemmatize

      public String[] lemmatize(String[] toks, String[] tags)
      Description copied from interface: Lemmatizer
      Generates lemmas for the word and postag.
      Specified by:
      lemmatize in interface Lemmatizer
      Parameters:
      toks - An array of the tokens
      tags - an array of the pos tags
      Returns:
      An array of possible lemmas for each token in the toks sequence.
    • lemmatize

      public List<List<String>> lemmatize(List<String> toks, List<String> tags)
      Description copied from interface: Lemmatizer
      Generates lemma tags for the word and postag.
      Specified by:
      lemmatize in interface Lemmatizer
      Parameters:
      toks - An array of the tokens
      tags - An array of the pos tags
      Returns:
      A list of every possible lemma for each token in the toks sequence.