edu.northwestern.at.morphadorner.corpuslinguistics.postagger.smoothing.lexical

## Class AdditiveLexicalSmoother

- java.lang.Object
- - edu.northwestern.at.utils.IsCloseableObject
  - - edu.northwestern.at.morphadorner.corpuslinguistics.postagger.smoothing.lexical.AbstractLexicalSmoother
    - - edu.northwestern.at.morphadorner.corpuslinguistics.postagger.smoothing.lexical.AdditiveLexicalSmoother

- All Implemented Interfaces:
    LexicalSmoother, UsesLogger
  Direct Known Subclasses:
    DefaultLexicalSmoother

      public class AdditiveLexicalSmoother
      extends AbstractLexicalSmoother
      implements LexicalSmoother

  Additive lexical smoother.

  A lexical smoother which adds a small positive value to each (word, tag) count to avoid zero probabilities. When the value added is 1, this is Laplace smoothing. When the value added is 0.5, this is Lidstone smoothing.

  This implementation uses 0.5 as the adjustment value (Lidstone smoothing).

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected double` | `additiveAdjustmentValue` Additive adjustment value = 0.5 (Lidstone smoothing).
    `protected boolean` | `debug` True if debugging enabled.

    - ### Fields inherited from class edu.northwestern.at.morphadorner.corpuslinguistics.postagger.smoothing.lexical.AbstractLexicalSmoother

      `cachedLexicalProbabilities, logger, partOfSpeechTagger`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AdditiveLexicalSmoother()` Create an additive lexical smoother.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Probability` | `lexicalProbability(java.lang.String word, java.lang.String tag)` Get lexically smoothed probability of a word given a tag.

    - ### Methods inherited from class edu.northwestern.at.morphadorner.corpuslinguistics.postagger.smoothing.lexical.AbstractLexicalSmoother

      `cachedProbabilitiesCount, clearCachedProbabilities, getLogger, setLogger, setPartOfSpeechTagger`

    - ### 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.morphadorner.corpuslinguistics.postagger.smoothing.lexical.LexicalSmoother

      `cachedProbabilitiesCount, clearCachedProbabilities, setPartOfSpeechTagger`

- - ### Field Detail

    - #### debug

          protected boolean debug

      True if debugging enabled.

    - #### additiveAdjustmentValue

          protected double additiveAdjustmentValue

      Additive adjustment value = 0.5 (Lidstone smoothing).

  - ### Constructor Detail

    - #### AdditiveLexicalSmoother

          public AdditiveLexicalSmoother()

      Create an additive lexical smoother.

  - ### Method Detail

    - #### lexicalProbability

          public Probability lexicalProbability(java.lang.String word,
                                       java.lang.String tag)

      Get lexically smoothed probability of a word given a tag.
      Specified by:
        `lexicalProbability` in interface `LexicalSmoother`
      Specified by:
        `lexicalProbability` in class `AbstractLexicalSmoother`
      Parameters:
        `word` - The word.
        `tag` - The part of speech tag.
      Returns:
        Lexically smoothed probability of word given tag, e.g., p( word | tag ).