'Learn the vocabulary dictionary and return term-document matrix.
This is equivalent to fit followed by transform, but more efficiently
implemented.
Parameters
raw_documents : iterable
An iterable which yields either str, unicode or file objects.
Returns
X : array, [n_samples, n_features]
Document-term matrix.'

def fit_transform(self, raw_documents, y=None):

    if isinstance(raw_documents, six.string_types):
        raise ValueError(u'Iterable    over    raw    text    documents    expected,    string    object    received.')
    self._validate_vocabulary()
    max_df = self.max_df
    min_df = self.min_df
    max_features = self.max_features
    (vocabulary, X) = self._count_vocab(raw_documents, self.fixed_vocabulary_)
    if self.binary:
        X.data.fill(1)
    if (not self.fixed_vocabulary_):
        X = self._sort_features(X, vocabulary)
        n_doc = X.shape[0]
        max_doc_count = (max_df if isinstance(max_df, numbers.Integral) else (max_df * n_doc))
        min_doc_count = (min_df if isinstance(min_df, numbers.Integral) else (min_df * n_doc))
        if (max_doc_count < min_doc_count):
            raise ValueError(u'max_df    corresponds    to    <    documents    than    min_df')
        (X, self.stop_words_) = self._limit_features(X, vocabulary, max_doc_count, min_doc_count, max_features)
        self.vocabulary_ = vocabulary
    return X
