Words
>>> ludic = open('ludic.txt','r').read()
>>> ludic.starts.date = 06.13.09
>>> ludic.place = 'online' + 'LA' = ...all
>>> situationist.action = 06.20.09
>>> situationist.action.place = g727
>>> import nltk
>>> tokens = nltk.word_tokenize(ludic)
>>> text = nltk.Text(tokens)
>>> text.collocations()
Building collocations list
Situationist Ludic; enGage ludiCity; Ludic Drifts; Los Angeles;
Algorithmic Planner; Information Gadgetry; Situationist Algorithmic;
Situationist Information; Situationist Drifting; Situationist
Disruptive
>>> fdist = nltk.FreqDist(text)
>>> vocab = fdist.keys()
>>> vocab[:50]
['(', ')', 'the', ',', 'Situationist', 'of', 'and', '.', 'a', '\x95', 'to', 'Lud
ic', 'contributors', 'ludiCity', 'for', 'will', 'enGage', 'GC', 'in', '\x93', '\
x94', 'by', ':', 'is', 'at', 'all', 'SLDs', 'collective', 'ludus', 'on', 'their'
, 'Drifts', 'with', 'process', 'ludic', 'site', 'play', 'through', 'group', '2.'
, 'SAP', 'using', 'one', 'locus', 'set', 'constituo', 'individual', 'drifting',
';', 'Planner']
>>> text.dispersion_plot(["ludic","Situationist","play"])
ludic-plot.png
>>> tagged = nltk.tag.pos_tag(tokens)
>>> for (word,tag) in tagged:
... if tag=='VB': # verb, base form
... print word
...
interrogate
disrupt
bridge
seek
gather
be
operate
enGage
have
reconvene
play
generate
>>> tagged2 = nltk.tag.pos_tag(text.vocab().keys())
>>> for (word,tag) in tagged2:
... if tag[0]=='V':
... print '%s (%s)' % (word,tag)
...
enGage (VB)
is (VBZ)
collective (VBP)
ludens (VBZ)
maps (VBZ)
agreed (VBD)
relationships (VBZ)
equipped (VBD)
input (VBN)
means (VBZ)
occurring (VBG)
enGaged (VBD)
processed (VBD)
drinks (VBZ)
integrates (VBZ)
invites (VBZ)
remains (VBZ)
entails (VBZ)
website (VBP)
exploring (VBG)
be (VB)
have (VBP)
generated (VBD)
operate (VBP)
registering (VBG)
>>> fdist.plot(25)
ludic-plot2.png
