katylava
10/26/2011 - 1:41 PM

nltk spaceships

nltk spaceships

In [21]: texts = [text1, text2, text3, text4, text5, text6, text7, text8, text9]

In [22]: for t in texts:
   ....:     print "%d spaceship(s) in %s" % (t.count('spaceship'), t)
   ....:     
0 spaceship(s) in <Text: Moby Dick by Herman Melville 1851>
0 spaceship(s) in <Text: Sense and Sensibility by Jane Austen 1811>
0 spaceship(s) in <Text: The Book of Genesis>
0 spaceship(s) in <Text: Inaugural Address Corpus>
0 spaceship(s) in <Text: Chat Corpus>
0 spaceship(s) in <Text: Monty Python and the Holy Grail>
0 spaceship(s) in <Text: Wall Street Journal>
0 spaceship(s) in <Text: Personals Corpus>
0 spaceship(s) in <Text: The Man Who Was Thursday by G . K . Chesterton 1908>