Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

an error caused by brackets #59

Closed
LTEnjoy opened this issue Mar 4, 2021 · 1 comment
Closed

an error caused by brackets #59

LTEnjoy opened this issue Mar 4, 2021 · 1 comment

Comments

@LTEnjoy
Copy link

LTEnjoy commented Mar 4, 2021

Hi, I ran into an error when ran the code:
words = ['(', 'There', 'is', 'no', 'doubt', ')'] and I got the error as follow:
IndexError: list index out of range
What is mystrious is that when I deleted the brackets '(' and ')', it worked.
Could you tell me how can I rewrite the code to make it work even with brackets?

@yzhangcs
Copy link
Owner

yzhangcs commented Mar 6, 2021

@LTEnjoy It's a bug of NLTK. A way is to replace the brackets with other symbols like '['/']'.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants