This change makes the script Python 2 and 3 compliant.
I ran 2to3, then adjusted the remove_punctuation() function to use a set() and join() instead of maketrans(). Surely this is latter change is not as efficient as maketrans(), but is arguably more readable.
I hope you find this useful and not a nuisance! If there are any adjustments you would like made, feel free to let me know and I can do so.
This change makes the script Python 2 and 3 compliant.
I ran
2to3
, then adjusted theremove_punctuation()
function to use aset()
andjoin()
instead ofmaketrans()
. Surely this is latter change is not as efficient asmaketrans()
, but is arguably more readable.I hope you find this useful and not a nuisance! If there are any adjustments you would like made, feel free to let me know and I can do so.