Python an open-source list of words by valence or categories for comparison
Question: I tend to take notes quite regularly and since the great tablet revolution
I've been taking them electronically. I've been trying to see if I can find
any patterns in the way I take notes. So I've put together a small hack to
load the notes and filter out proper nouns and fluff to leave a list of key
words I employ.

    
    
    import os
    import re
    
    dr = os.listdir('/home/notes')
    dr = [i for i in dr if re.search('.*txt$',i)]
    ignore = ['A','a','of','the','and','in','at','our','my','you','your','or','to','was','will','because','as','also','is','eg','e.g.','on','for','Not','not']
    words = set()
    d1 = open('/home/data/en_GB.dic','r')
    dic = d1.read().lower()
    dic = re.findall('[a-z]{2,}',dic)
    sdic = set(dic)
    for i in dr:
        a = open(os.path.join('/home/notes',i),'r')
        atmp = a.read()
        atmp = atmp.lower()
        atmp = re.findall('[a-z]{3,}',atmp)
        atmp = set(atmp)
        atmp.intersection_update(sdic)
        atmp.difference_update(set(ignore))
        words.update(atmp)
        a.close()
    
    words = sorted(words)
    

I now have a list of about 15,000 words I regularly use while taking notes. It
would be a little unmanageable to sort by hand and I wondered if there was an
open-source library of `positive-negative-neutral` or `optimistic-pessimistic-
indifferent` or other form of word list along any meaning scale that I could
run the word list through.

In a perfect scenario I would also be able to run it through some kind of
thesarus so I could group the words into meaning clusters to get a high level
view of what sense terms I've been employing most.

Does anyone know if there are any such lists out there and if so, how would I
go about employing them in Python?

Thanks


Answer: I found a list of words used for sentiment analysis of Twitter at:
<http://alexdavies.net/twitter-sentiment-analysis/>

It includes example Python code for how to use it.

See also: [Sentiment Analysis
Dictionaries](http://stackoverflow.com/questions/4188706/sentiment-analysis-
dictionaries)

