From c3574e45a3a18d8964f04316fc7305329afe1120 Mon Sep 17 00:00:00 2001 From: Yuval Adam Date: Fri, 6 May 2011 00:36:19 +0300 Subject: added brown TextCollection --- brown.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 brown.py diff --git a/brown.py b/brown.py new file mode 100644 index 0000000..c5d3974 --- /dev/null +++ b/brown.py @@ -0,0 +1,9 @@ +from nltk.corpus import brown +from nltk.text import TextCollection + +# the default initialization for a corpus fails +# since files() was changed to fileids() +# anyway, brown_collection = TextCollection(brown) doesn't work +# so we use this workaround +words = [brown.words(f) for f in brown.fileids()] +brown_collection = TextCollection(words) -- cgit v1.3.1