bnosac / textrank

Summarise text by finding relevant sentences and keywords using the Textrank algorithm
77 stars 9 forks source link

textrank_sentences to filter out dataframes of one sentence #3

Closed Anjs04 closed 6 years ago

Anjs04 commented 6 years ago

textrank_sentences() should contain stopif(dim(sentences)[1] == 1) to cover the case in which textrank_sentences if fed a piece of text that tokenises to only one sentence.

jwijffels commented 6 years ago

What is the point in applying textrank_sentences if you only have one sentence?

Anjs04 commented 6 years ago

Applying textrank_sentences to multiple pieces of text with an unknown amount of sentences. It causes a memory leak instead of just returning an error.

jwijffels commented 6 years ago

I've added your suggested stop condition in the function.