Novelwriting 0.3: rule-based random document generation

Jeff Epler jepler@unpythonic.net
Sat, 5 Apr 2003 11:32:15 -0600


http://unpythonic.net/~jepler/novelwriting/index.html

Description
-----------

Novelwriting[1] generates random text based on a user-defined grammar.
It is similar to the Dada Engine[2], which is used by the Postmondernism
Generator[3].  The name was chosen based on the Monty Python sketch,
"Thomas Hardy / Novel Writing"[4].  It requires Python 2.2.


Example
-------
Start: folk-saying;
folk-saying: person " once said that " folk-saying ".\n";
person: "My " relative | "The President" | "Cardinal Fang";
relative: "mother" | "aunt" | "grandmother" ;
folk-saying: "a rolling stone gathers no moss"
    | "a stitch in time saves nine"
    | "no-one expects the Spanish Inquisition";
;;


Advantages compared to the Dada Engine
--------------------------------------
The Dada Engine has only a limited degree of programmability.  In
Novelwriting, you can use the full power of Python at any point in a rule.
For example:
	Start: product-claim
	product-name: "Novelwriting" | "Dada Engine";
	product-claim:
		@set(this-product, product-name)
		" is twice as good as "
		@alternative(product-name, @get(this-product));
	;;
	from novelwriting.calls import get, set, alternative
(The facility provided by @get/@set is available in the Dada Engine, 
but @alternative is impossible to write)


Limitations compared to the Dada Engine
---------------------------------------
Novelwriting does not have a formatting library like the Dada Engine.
Novelwriting does not have a nice syntax for text substitution rules or
maps.  Novelwriting does not have parameterized rules.


[1] http://unpythonic.net/~jepler/novelwriting/index.html
[2] http://dev.null.org/dadaengine/
[3] http://www.csse.monash.edu.au/cgi-bin/postmodern
[4] http://www.stone-dead.asn.au/albums-cds/sketches/matching-tie-and-handkerchief/thomas-hardy-novel-writing.html