re: Build a quick Summarizer with Python and NLTK VIEW POST

VIEW PARENT COMMENT VIEW FULL DISCUSSION

You may have a string that is less than your string length sentence[:2]. I would recommend printing the strings and see if this is the case

i have solved it..it was acctually puncutation problem..in my case...i just handle dot(.) character while giving words as value..

Could you please help me , i'm facing same problem here and i can't handle it , tahnk you.

Is this your error?

IndexError: string index out of range

If so, potential solutions could be:

  • Having a string that is less than your string length sentence[:2]. I would recommend printing the strings and see if this is the case.
  • Punctuation problem, like phabonislam explained above.

If that doesn't solve it, let me know!

code of conduct - report abuse