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

## Interface ContextualSmoother

- All Known Implementing Classes:
    AbstractContextualSmoother, AdditiveContextualSmoother, DefaultContextualSmoother, DeletedInterpolationContextualSmoother

      public interface ContextualSmoother

  Interface for a contextual smoother.

  A contextual smoother computes the contextually smoothed probabability of a word given a part of speech tag, e.g., p( word | tag ).

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `cachedProbabilitiesCount()` Get the number of cached contextual probabilities.
    `void` | `clearCachedProbabilities()` Clear cached probabilities..
    `Probability` | `contextualProbability(java.lang.String tag, java.lang.String previousTag)` Compute smoothed contextual probability of a tag given the previous tag.
    `Probability` | `contextualProbability(java.lang.String tag, java.lang.String previousTag, java.lang.String previousPreviousTag)` Compute smoothed contextual probability of a tag given the previous tags.
    `void` | `setPartOfSpeechTagger(PartOfSpeechTagger posTagger)` Set the part of speech tagger for this smoother.

- - ### Method Detail

    - #### setPartOfSpeechTagger

          void setPartOfSpeechTagger(PartOfSpeechTagger posTagger)

      Set the part of speech tagger for this smoother.
      Parameters:
        `posTagger` - Part of speech tagger for which this smoother provides probabilities.

    - #### cachedProbabilitiesCount

          int cachedProbabilitiesCount()

      Get the number of cached contextual probabilities.
      Returns:
        The number of cached contextual probabilities.

    - #### clearCachedProbabilities

          void clearCachedProbabilities()

      Clear cached probabilities..

    - #### contextualProbability

          Probability contextualProbability(java.lang.String tag,
                                          java.lang.String previousTag)

      Compute smoothed contextual probability of a tag given the previous tag.
      Parameters:
        `tag` - The current tag.
        `previousTag` - The previous tag.
      Returns:
        The probability of the current tag given the previous tag, e.g, p( tag | previousTag ).

    - #### contextualProbability

          Probability contextualProbability(java.lang.String tag,
                                          java.lang.String previousTag,
                                          java.lang.String previousPreviousTag)

      Compute smoothed contextual probability of a tag given the previous tags.
      Parameters:
        `tag` - The current tag.
        `previousTag` - The previous tag.
        `previousPreviousTag` - The previous tag of the previous tag.
      Returns:
        The probability of the current tag given the previous two tags, e.g, p( tag | prevTag , prevPrevTag ).