Skip to content
Permalink
8e9a44c0d1
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
26 lines (21 sloc) 624 Bytes
import math
import nltk
from nltk.corpus import wordnet as wn
from nltk.corpus import brown as sc
from collections import Counter
from sets import Set
class cblexicon:
def genSets(self):
f = open('words.txt', 'r+')
content = f.readlines()
positive = Set([])
negative = Set([])
for pair in content:
current = pair.split(' ')
if (current[1][0] == 'p'):
positive.add(current[0])
elif (current[1][0] == 'n'):
negative.add(current[0])
print len(positive)
print len(negative)
cblexicon().genSets()