'Return a list of the categories that are defined for this corpus,
or for the file(s) if it is given.'

def categories(self, fileids=None):

    if (self._f2c is None):
        self._init()
    if (fileids is None):
        return sorted(self._c2f)
    if isinstance(fileids, string_types):
        fileids = [fileids]
    return sorted(set.union(*[self._f2c[d] for d in fileids]))
