fabianvf/python-rake

[Python3.5] AttributeError: 'dict' object has no attribute 'iteritems'

Closed this issue · 1 comments

The above issue occurs when trying to run the following code:

import RAKE
import os

rake = RAKE.Rake(os.path.dirname(__file__) + '/../stoplist/japanese.stop')
text = 'これそれあれこのそのあの'
keywords = rake.run(text)
print(keywords)

Here's the stacktrace:

Traceback (most recent call last):
  File "/vagrant/workspace/bambooshoot-ads/analytics/core/keyword.py", line 6, in <module>
    keywords = rake.run(text)
  File "/home/vagrant/.pyenv/versions/3.5.0/lib/python3.5/site-packages/RAKE/RAKE.py", line 132, in run
    sorted_keywords = sorted(keyword_candidates.iteritems(), key=operator.itemgetter(1), reverse=True)
AttributeError: 'dict' object has no attribute 'iteritems'

Appears to be an issue in the original code, as you can see here: aneesha/RAKE#9

I've attempted the above fix without success.

My bad, appears there's a PR already open with a fix for this.

Is there any timeline on the PR being merged to master?