edu.northwestern.at.morphadorner.corpuslinguistics.lemmatizer

## Class AbstractStemmerLemmatizer

- java.lang.Object
- - edu.northwestern.at.utils.IsCloseableObject
  - - edu.northwestern.at.morphadorner.corpuslinguistics.lemmatizer.AbstractLemmatizer
    - - edu.northwestern.at.morphadorner.corpuslinguistics.lemmatizer.AbstractStemmerLemmatizer

- All Implemented Interfaces:
    Lemmatizer, IsCloseable, UsesLogger
  Direct Known Subclasses:
    LancasterStemmerLemmatizer, PorterStemmerLemmatizer

      public abstract class AbstractStemmerLemmatizer
      extends AbstractLemmatizer
      implements IsCloseable, Lemmatizer

  Use a stemmer as a pseudo-lemmatizer.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected java.util.Map<java.lang.String,java.lang.String>` | `stemMap` Map with spellings as keys and stems as values.
    `protected Stemmer` | `stemmer` The stemmer.

    - ### Fields inherited from class edu.northwestern.at.morphadorner.corpuslinguistics.lemmatizer.AbstractLemmatizer

      `dictionary, lemmaSeparator, lemmaSeparatorString, lexicon, logger`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractStemmerLemmatizer()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `lemmatize(java.lang.String spelling)` Returns a lemma given a spelling.
    `java.lang.String` | `lemmatize(java.lang.String spelling, java.lang.String wordClass)` Returns a lemma given a word and a part of speech.
    `void` | `setLexicon(Lexicon lexicon)` Set the lexicon containing the lemmata.

    - ### Methods inherited from class edu.northwestern.at.morphadorner.corpuslinguistics.lemmatizer.AbstractLemmatizer

      `cantLemmatize, countLemmata, getLemmaSeparator, getLogger, isCompoundLemma, joinLemmata, joinLemmata, setDictionary, setLogger, splitLemma`

    - ### Methods inherited from class edu.northwestern.at.utils.IsCloseableObject

      `close`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface edu.northwestern.at.utils.IsCloseable

      `close`

    - ### Methods inherited from interface edu.northwestern.at.morphadorner.corpuslinguistics.lemmatizer.Lemmatizer

      `cantLemmatize, countLemmata, getLemmaSeparator, isCompoundLemma, joinLemmata, joinLemmata, setDictionary, splitLemma`

- - ### Field Detail

    - #### stemmer

          protected Stemmer stemmer

      The stemmer.

    - #### stemMap

          protected java.util.Map<java.lang.String,java.lang.String> stemMap

      Map with spellings as keys and stems as values.

  - ### Constructor Detail

    - #### AbstractStemmerLemmatizer

          public AbstractStemmerLemmatizer()

  - ### Method Detail

    - #### setLexicon

          public void setLexicon(Lexicon lexicon)

      Set the lexicon containing the lemmata.
      Specified by:
        `setLexicon` in interface `Lemmatizer`
      Overrides:
        `setLexicon` in class `AbstractLemmatizer`
      Parameters:
        `lexicon` - The lexicon. Not used here.

        A no-op since the stemmer doesn't need a lexicon.

    - #### lemmatize

          public java.lang.String lemmatize(java.lang.String spelling,
                                   java.lang.String wordClass)

      Returns a lemma given a word and a part of speech.
      Specified by:
        `lemmatize` in interface `Lemmatizer`
      Specified by:
        `lemmatize` in class `AbstractLemmatizer`
      Parameters:
        `spelling` - The spelling.
        `wordClass` - The word class.
      Returns:
        The lemma.

        This actually returns the stemmed form of the spelling, not the lemma.

    - #### lemmatize

          public java.lang.String lemmatize(java.lang.String spelling)

      Returns a lemma given a spelling.
      Specified by:
        `lemmatize` in interface `Lemmatizer`
      Specified by:
        `lemmatize` in class `AbstractLemmatizer`
      Parameters:
        `spelling` - The spelling.
      Returns:
        The lemma. "*" is returned if the lemma cannot be found.