'Creates an information content lookup dictionary from a corpus.
:type corpus: CorpusReader
:param corpus: The corpus from which we create an information
content dictionary.
:type weight_senses_equally: bool
:param weight_senses_equally: If this is True, gives all
possible senses equal weight rather than dividing by the
number of possible senses.  (If a word has 3 synses, each
sense gets 0.3333 per appearance when this is False, 1.0 when
it is true.)
:param smoothing: How much do we smooth synset counts (default is 1.0)
:type smoothing: float
:return: An information content dictionary'

def ic(self, corpus, weight_senses_equally=False, smoothing=1.0):

    counts = FreqDist()
    for ww in corpus.words():
        counts[ww] += 1
    ic = {}
    for pp in POS_LIST:
        ic[pp] = defaultdict(float)
    if (smoothing > 0.0):
        for ss in self.all_synsets():
            pos = ss._pos
            if (pos == ADJ_SAT):
                pos = ADJ
            ic[pos][ss._offset] = smoothing
    for ww in counts:
        possible_synsets = self.synsets(ww)
        if (len(possible_synsets) == 0):
            continue
        weight = float(counts[ww])
        if (not weight_senses_equally):
            weight /= float(len(possible_synsets))
        for ss in possible_synsets:
            pos = ss._pos
            if (pos == ADJ_SAT):
                pos = ADJ
            for level in ss._iter_hypernym_lists():
                for hh in level:
                    ic[pos][hh._offset] += weight
            ic[pos][0] += weight
    return ic
