Separating nltk.FreqDist words into two lists?
问题 I have a series of texts that are instances of a custom WebText class. Each text is an object that has a rating (-10 to +10) and a word count (nltk.FreqDist) associated with it: >>trainingTexts = [WebText('train1.txt'), WebText('train2.txt'), WebText('train3.txt'), WebText('train4.txt')] >>trainingTexts[1].rating 10 >>trainingTexts[1].freq_dist <FreqDist: 'the': 60, ',': 49, 'to': 38, 'is': 34,...> How can you now get two lists (or dictionaries) containing every word used exclusively in the