def __call__(self, document, sentences_count):
    self._ensure_dependecies_installed()
    dictionary = self._create_dictionary(document)
    if (not dictionary):
        return ()
    matrix = self._create_matrix(document, dictionary)
    matrix = self._compute_term_frequency(matrix)
    (u, sigma, v) = singular_value_decomposition(matrix, full_matrices=False)
    ranks = iter(self._compute_ranks(sigma, v))
    return self._get_best_sentences(document.sentences, sentences_count, (lambda s: next(ranks)))
def __call__(self, document, sentences_count):
    self._ensure_dependecies_installed()
    dictionary = self._create_dictionary(document)
    if (not dictionary):
        return ()
    matrix = self._create_matrix(document, dictionary)
    matrix = self._compute_term_frequency(matrix)
    (u, sigma, v) = singular_value_decomposition(matrix, full_matrices=False)
    ranks = iter(self._compute_ranks(sigma, v))
    return self._get_best_sentences(document.sentences, sentences_count, (lambda s: next(ranks)))