nltk - TypeError - Translate takes one argument.(2 given) Python -
i have following code import nltk, os, json, csv, string, cpickle scipy.stats import scoreatpercentile lmtzr = nltk.stem.wordnet.wordnetlemmatizer() def sanitize(wordlist): answer = [word.translate(none, string.punctuation) word in wordlist] answer = [lmtzr.lemmatize(word.lower()) word in answer] return answer words = [] filename in json_list: words.extend([sanitize(nltk.word_tokenize(' '.join([tweet['text'] tweet in json.load(open(filename,read))])))]) i've tested lines 2-4 in separate testing.py file when wrote import nltk, os, json, csv, string, cpickle scipy.stats import scoreatpercentile wordlist= ['\'the', 'the', '"the'] print wordlist wordlist2 = [word.translate(none, string.punctuation) word in wordlist] print wordlist2 answer = [lmtzr.lemmatize(word.lower()) word in wordlist2] print answer freq = nltk.freqdist(wordlist2) print freq and command prompt returns ['the','the...