RAKE icon indicating copy to clipboard operation
RAKE copied to clipboard

Python 3 incompatible

Open louwersj opened this issue 10 years ago • 2 comments

It looks like some parts of the code are not able to work with the latest releases of Python.

below code is used in rake.py sorted_keywords = sorted(keyword_candidates.iteritems(), key=operator.itemgetter(1), reverse=True)

However, iteritems() is no longer supported in python 3, this makes that the code cannot be used in the latest releases of Python.

louwersj avatar Jun 13 '15 12:06 louwersj

To ensure it will work with python 3 you will need to write the line as shown in the example below:

sorted_keywords = sorted(iter(keyword_candidates.items()), key=operator.itemgetter(1), reverse=True)

louwersj avatar Jun 13 '15 12:06 louwersj

#11 should fix this.

sfischer13 avatar Jun 05 '17 15:06 sfischer13