Permalink
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?
BigData/cblexicon.py
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Hand tagged the brown dataset for the conjunction approach. My two gloss approaches seem to be in git hell, will hopefully get to optimize the jwb edits.
26 lines (21 sloc)
624 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |