<s> import os , sys ; sys . path . insert ( <NUM_LIT:0> , os . path . join ( os . path . dirname ( __file__ ) , "<STR_LIT:..>" , "<STR_LIT:..>" ) ) <EOL> import codecs <EOL> from pattern . vector import Document , PORTER , LEMMA <EOL> s = """<STR_LIT>""" <EOL> document = Document ( s , threshold = <NUM_LIT:1> , stopwords = False ) <EOL> print document . words <EOL> print <EOL> f = os . path . join ( os . path . dirname ( __file__ ) , "<STR_LIT>" , "<STR_LIT>" ) <EOL> s = codecs . open ( f , encoding = "<STR_LIT:utf-8>" ) . read ( ) <EOL> document = Document ( s , name = "<STR_LIT>" , stemmer = PORTER ) <EOL> print document <EOL> print document . keywords ( top = <NUM_LIT:10> ) <EOL> print <EOL> document = Document ( s , name = "<STR_LIT>" , stemmer = LEMMA ) <EOL> print document <EOL> print document . keywords ( top = <NUM_LIT:10> ) <EOL> print <EOL> document = Document ( "<STR_LIT>" , stopwords = True ) <EOL> print document . words <EOL> print document . vector . features <EOL> for feature , weight in document . vector . items ( ) : <EOL> print feature , weight </s>
