'Distributional similarity: find other words which appear in the
same contexts as the specified word; list most similar words first.
:param word: The word used to seed the similarity search
:type word: str
:param num: The number of words to generate (default=20)
:type num: int
:seealso: ContextIndex.similar_words()'

def similar(self, word, num=20):

    if (u'_word_context_index' not in self.__dict__):
        self._word_context_index = ContextIndex(self.tokens, filter=(lambda x: x.isalpha()), key=(lambda s: s.lower()))
    word = word.lower()
    wci = self._word_context_index._word_to_contexts
    if (word in wci.conditions()):
        contexts = set(wci[word])
        fd = Counter((w for w in wci.conditions() for c in wci[w] if ((c in contexts) and (not (w == word)))))
        words = [w for (w, _) in fd.most_common(num)]
        print(tokenwrap(words))
    else:
        print(u'No    matches')
