"IndexError: string index out of range" on trying to stem the word "oing"
See original GitHub issueEasy to reproduce:
>>> from nltk import PorterStemmer
>>> stemmer = PorterStemmer()
>>> stemmer.stem('oing')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/peterbe/virtualenvs/songsearch/lib/python3.5/site-packages/nltk/stem/porter.py", line 665, in stem
stem = self._step1b(stem)
File "/Users/peterbe/virtualenvs/songsearch/lib/python3.5/site-packages/nltk/stem/porter.py", line 376, in _step1b
lambda stem: (self._measure(stem) == 1 and
File "/Users/peterbe/virtualenvs/songsearch/lib/python3.5/site-packages/nltk/stem/porter.py", line 258, in _apply_rule_list
if suffix == '*d' and self._ends_double_consonant(word):
File "/Users/peterbe/virtualenvs/songsearch/lib/python3.5/site-packages/nltk/stem/porter.py", line 214, in _ends_double_consonant
word[-1] == word[-2] and
IndexError: string index out of range
>>> import nltk
>>> nltk.__version__
'3.2.2'
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:5 (2 by maintainers)
Top Results From Across the Web
IndexError: string index out of range - Net-Informations.Com
The string index out of range means that the index you are trying to access does not exist. In a string, that means...
Read more >How to fix IndexError: String index out of range - Python
I am trying to make a parser for my text adventure. I used a text file called test.txt. I keep getting IndexError: string...
Read more >Python error: string index out of range python - Intellipaat
The string index out of range means that the index you are trying to access does not exist. In a string, that means...
Read more >IndexError: String Index out of Range - The Renegade Coder
According to Python documentation, an IndexError is raised whenever “a sequence subscript is out of range.” Of course, what does that really ...
Read more >Python TypeError: string index out of range Solution
The “TypeError: string index out of range” error is raised when you try to access an item at an index position that does...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
So, has the issue been resolved?
Close as fixed?