Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 26 lines (22 sloc) 852 Bytes
import os
def filter_adj(olddir, newdir):
if not os.path.isdir(newdir):
for filename in os.listdir(olddir):
f = open("%s/%s" % (olddir,filename)).read().split("\n")
w = open("%s/%s" % (newdir,filename), 'w')
for word in f:
if word[-4:]=='_VBZ' or word[-4:]=="_VBD" or word[-3:]=="_VB":
w.write("%s\n" % word)
if __name__ == "__main__":
# usage: python -d neg
# usage: python -d yelp/default/1star
from optparse import OptionParser
parser = OptionParser()
parser.add_option("-d", "--dir", dest="directory")
(options, args) = parser.parse_args()
olddir = "%s_tagged" %
newdir = "%s_verb" %
Something went wrong with that request. Please try again.