I am doing POS tagging using nltk package in python. Now it's showing error string index out of range even though my string not much big.
import nltk
sample_list = ['', 'emma', 'jane', 'austen', '1816', '', 'volume', 'chapter', 'emma', 'woodhouse', ' ','handsome', ' ', 'clever', ' ', 'rich', ' ', 'comfortable', 'home', 'happy', 'disposition', ' ','seemed', 'unite', 'best','blessings', 'existence', '', 'lived','nearly', 'twenty-one', 'years','world', 'little', 'distress', 'vex', '', 'youngest','two']
tagged = nltk.pos_tag(sample_list)
Your problem is with empty strings, namely ''
so you can use:
tagged = nltk.pos_tag([i for i in sample_list if i])