'Trains the classifier with the given document of the given type (i.e., class).
A document can be a Document, Vector, dict, list or string.
If no type is given, Document.type will be used instead.'

def train(self, document, type=None):

    (type, vector) = self._vector(document, type)
    self._vectors.append((type, vector))
    self._classes[type] = (self._classes.get(type, 0) + 1)
