I am trying to use nltk to handle some words, but there is a warning. I will find out if there is a word " Nations" , the program will trigger a warning. I wonder if there is a way to stop the program after a warning is raised. Thanks you
warning:
*UnicodeWarning: Unicode equal comparison failed to convert both arguments to Unicode - interpreting them as being unequal
if word[0].lower() not in stopwords.words():*
source
share