Mercurial > hg > wordstream
changeset 5:0c2b1fe8f53f
update documentation a little
author | k0s <k0scist@gmail.com> |
---|---|
date | Sun, 14 Feb 2010 13:25:01 -0500 |
parents | 28c7009bc463 |
children | ffe01043ecea |
files | README.txt setup.py wordstream/dissociate.py wordstream/main.py |
diffstat | 4 files changed, 64 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/README.txt Sun Feb 14 13:25:01 2010 -0500 @@ -0,0 +1,45 @@ +wordstream +========== + +wordstream is a simple corpus of text associations and tools to use them. Feeding the corpus text will grow a stack of left to right word associations on a per word basis. Words are defined (for now) as the bits that sit between whitespace. The corpus can then be eaten: given a word, pop the top of its stack. + +There are two interfaces to the corpus in the wordstream package: +wordstream and dissociate. Additional applications of wordstream can +also be imagined. + +The wordstream source is at http://k0s.org/hg/wordstream + + +wordstream interface +-------------------- + +An interactive interface for eating and feeding the corpus. Wordstream has a command line interface, ``wordstream``, and a web interface usable by running ``paster serve wordstream.ini`` . In both cases, the usage is the same. From an initial corpus, the user types lines of text. wordstream will eat the corpus and print a response to the text and feed the user's lines to the corpus + + +dissociate interface +-------------------- + +Named after emacs' ``M-x dissociated-press`` (try it!), dissociate will feed documents to a corpus, scramble the corpus (shuffle the stack order for each word), and output the corpus eating itself, selecting random words, eating their associations, and then eating the associations of the associations until the corpus is empty. Dissociate has a command line interface (install the software and run ``dissociate --help`` for usage), and a web interface usable via paster serve dissociate.ini. + +Applications +------------ + +While the wordstream corpus is a simple model, the basic idea can be +used to + + * Thesaurus: By feeding the corpus synonyms, wordstream could be used + as a thesaurus program. Synonymity could be indicated via either + word count or by position towards the top of the stack. The + thesaurus could be displayed as a web interface to allow automatic + suggestions while writing + + * Writing analysis: The amount of text on the web is vast. + Wordstream could be used to present what is being talked about most + within a number of websites and what is associated to it. + + * Collaborative fiction: Since wordstream can use a collective corpus + that is fed by interacting with it, several authors could + simultaneously iteract with the wordstream web interface each + feeding the collective corpus and literally eating each others' + words +
--- a/setup.py Fri Feb 12 12:39:14 2010 -0500 +++ b/setup.py Sun Feb 14 13:25:01 2010 -0500 @@ -1,15 +1,18 @@ +import os from setuptools import setup, find_packages -version = "0.1" +try: + filename = os.path.join(os.path.dirname(__file__), 'README.txt') + description = file(filename).read() +except: + description = "" + +version = "0.1.1" setup(name='wordstream', version=version, description="word streamer; conversational and dissociatively play with text with a command line and web interface", - long_description=""" -for a demo, see http://k0s.org/wordstream and http://k0s.org/dissociate - -Additional documentation forthcoming, until the, the docs == the source -""", + long_description=description, classifiers=[], # Get strings from http://www.python.org/pypi?%3Aaction=list_classifiers author='Jeff Hammel', author_email='k0scist@gmail.com',
--- a/wordstream/dissociate.py Fri Feb 12 12:39:14 2010 -0500 +++ b/wordstream/dissociate.py Sun Feb 14 13:25:01 2010 -0500 @@ -21,11 +21,14 @@ def main(args=sys.argv[1:]): - parser = OptionParser() + parser = OptionParser('%prog <path_or_url> <path_or_url> <...>') options, args = parser.parse_args() corpus = Corpus() - corpus.feed_stuff(*args) + if args: + corpus.feed_stuff(*args) + else: + corpus.feed_stream(sys.stdin.read()) corpus.scramble() dissociate(corpus)
--- a/wordstream/main.py Fri Feb 12 12:39:14 2010 -0500 +++ b/wordstream/main.py Sun Feb 14 13:25:01 2010 -0500 @@ -9,11 +9,12 @@ from wordstream.api import Corpus def main(args=sys.argv[1:]): - parser = OptionParser() + parser = OptionParser('%prog [options] <path_or_url> <path_or_url> <...>') parser.add_option('--print-corpus', dest='print_corpus', default=False, - action='store_true') + action='store_true', + help="print the given corpus of associations") parser.add_option('-n', type='int', dest='n', default=1, - help='number of words to eat') + help='number of words to eat per munch') options, args = parser.parse_args() corpus = Corpus() @@ -21,6 +22,7 @@ corpus.feed_stuff(*args) if options.print_corpus: pprint(corpus) + sys.exit(0) n = 1