Esempio n. 1
0
from hw1 import Hw1

infilename='review_KcSJUq1kwO8awZRMS6Q49g'
f=open(infilename,'r')

tokens = Hw1.tokenize(Hw1.read_line(f.readline())['text'])
stop_removed = Hw1.stopword(tokens)
stemmed = Hw1.stemming(stop_removed)

print 'task-4.py // print out the "text" part of the first review after stemming'
print stemmed
Esempio n. 2
0
from hw1 import Hw1

infilename='review_KcSJUq1kwO8awZRMS6Q49g'
f=open(infilename,'r')
line_num=1
while(line_num<300):
    f.readline()
    line_num+=1
    
print 'task-1.py // print out the "text" part of the 300th review'
print Hw1.read_line(f.readline())['text']
from hw1 import Hw1

infilename='review_KcSJUq1kwO8awZRMS6Q49g'
f=open(infilename,'r')
line_num=1
while(line_num<3):
    line = Hw1.read_line(f.readline())['text']
    print "Original: %s" %line
    print Hw1.tokenize(line)
    line_num+=1

Esempio n. 4
0
from hw1 import Hw1

infilename = 'review_KcSJUq1kwO8awZRMS6Q49g'
f = open(infilename, 'r')
line_num = 1
while (line_num < 300):
    f.readline()
    line_num += 1

print 'task-1.py // print out the "text" part of the 300th review'
print Hw1.read_line(f.readline())['text']
Esempio n. 5
0
from hw1 import Hw1

infilename = 'review_KcSJUq1kwO8awZRMS6Q49g'
f = open(infilename, 'r')

tokens = Hw1.tokenize(Hw1.read_line(f.readline())['text'])
stop_removed = Hw1.stopword(tokens)
stemmed = Hw1.stemming(stop_removed)

print 'task-4.py // print out the "text" part of the first review after stemming'
print stemmed