![]() | Formal Language Expander | |||
|
After laughing at TheSpark's BoneEasy(TM), I thought I'd play with this idea myself. This script expands an unrestricted grammar (although you can make it recurse infinitely until it quits with an exception). My girlfriend and I had a lot of fun making rule files for it. The file format is very easy:
Where A and B are non-terminals, and x and y are arbitrary combinations of terminals and non-terminals. In plain English, A and B are words to be replaced by the strings x and y respectively. To mark something to be replaced, you surround it with curly braces. e.g.
Here's an example execution:
DownloadPlease Sir...I'm busy working on a new version of this, suitable for inclusion in Shade. The new version features the ability to assign probabilities to each expansion and associate each with a set of qualifiers to codify consistency across iterations in the expansion. |