https://github.com/alvisespano/Polygen
Polygen — a first effort towards satyre in computer science.
Table of Contents
SUBMODULE NOTE — This project contains a submodule (grammars
folder); don't forget to initialize it (once) after cloning:
git submodule update --init --recursive
Also, to keep the submodule always up to date with the latest changes, don't forget to use:
git submodule update
For more information on Git submodules, see:
Polygen is a command line program for generating random sentences according to a grammar definition, that is following custom syntactical and lexical rules. It takes a text file as source program defining a grammar by means of BNF-like rules and executes it, eventually showing the result.
Here a source program is a grammar definition, the execution consists in the exploration of such grammar by selecting a random path and the result is the sentence built on the way.
Polygen is fairly slim and does not need that powerful computer in order to work.
From a theoretical point of view, there could be unlucky cases making the program loop for a sensible amount of time over a certain recursive production; in the real world, though, it will never happen.
Everything you need is a shell or command line interpreter (such as Bash or Csh under UNIX/Linux or the DOS Command Prompt under Windows) and, only in case you wish to write/view a grammar source file, a plain text editor/viewer.
Polygen packages come in a variety of flavours, some providing different executable files in a platform-dependent way. Be sure the one you downloaded suits your machine and operating system.
A package containing the full source code exists as well and is intended for either people who just wish to know how Polygen works or users whose platform is not directly supported by a package containing an executable file for their machine. The latter will be able to compile the program by themselves following the instructions in the README file located in the source directory.
Polygen needs no installation: it just consists of an executable file and a bunch of grammar sources.
Leave it as is in an own directory and 'cd
' there when you want to use it.
Refer to platform-dependant README
file for additional hints.
In the root of this project you'll find a Zip archive containing the precompiled binaries of Polygen and PolyGUI, along with the correct version of cygwin1.dll
required for running Polygen under Windows 10:
Polygen1.6.0-PolyGUI_Win10.zip
(direct download link)
Just unpack its contents and you're ready to use it.
The executable file must be launched from a shell or command line interpreter, as stated in section 1.1.2. It takes a set of arguments and prints to standard output, which is the shell terminal itself by default. For the formal synopsis run the executable with no arguments.
For a detailed guide on Polygen Meta Language (PML), the grammar definition language interpreted by Polygen, see the documentation included in the /docs/
folder:
polygen-spec_EN.html
— English (HTML Preview)polygen-spec_IT.html
— Italian (HTML Preview)
- Remember to provide an "
I
" non-terminal symbol in your own grammar files for the-info
option. - Try to avoid as many warnings as possible when developing your own grammar sources: your definitions will be more robust and won't lead to unexpected outputs.