'Returns a list of synonyms for the current ngram.
:param ngram: ngram to lookup
:type ngram: C{string}
:param fileid: thesaurus fileid to search in. If None, search all fileids.
:type fileid: C{string}
:return: If fileid is specified, list of synonyms; otherwise, list of tuples of fileids and
lists, where inner lists contain synonyms.'

def synonyms(self, ngram, fileid=None):

    if fileid:
        return self._thesaurus[fileid][ngram].keys()
    else:
        return [(fileid, self._thesaurus[fileid][ngram].keys()) for fileid in self._fileids]
