':param freqdist: The trigram frequency distribution upon which to base
the estimation
:type freqdist: FreqDist
:param bins: Included for compatibility with nltk.tag.hmm
:type bins: int or float
:param discount: The discount applied when retrieving counts of
trigrams
:type discount: float (preferred, but can be set to int)'

def __init__(self, freqdist, bins=None, discount=0.75):

    if (not bins):
        self._bins = freqdist.B()
    else:
        self._bins = bins
    self._D = discount
    self._cache = {}
    self._bigrams = defaultdict(int)
    self._trigrams = freqdist
    self._wordtypes_after = defaultdict(float)
    self._trigrams_contain = defaultdict(float)
    self._wordtypes_before = defaultdict(float)
    for (w0, w1, w2) in freqdist:
        self._bigrams[(w0, w1)] += freqdist[(w0, w1, w2)]
        self._wordtypes_after[(w0, w1)] += 1
        self._trigrams_contain[w1] += 1
        self._wordtypes_before[(w1, w2)] += 1
