🎱 A Markov process-based word generator inside a physics ballpool
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
bin
embed
screenshots
.gitattributes
.gitignore
.travis.yml
CodeCompletion.hx
LICENSE
Main.hx
README.md
TrainingDataBuilder.hx
WordReactor.hxml
WordReactor.hxproj
debug.hxml
release.hxml

README.md

Project logo

Build Status

Word Reactor is a Markov chain-based word generator running inside a physics simulation. Run it in your browser.

Demonstrates the Markov Namegen name generator and Haxe library.

Usage

Open it in the browser and generate words. Click or tap empty spaces to spawn stream of words for different topics. Drag the balls around to mix things up, and collide the balls with "topic" words in them to create new words:

Screenshot

Install

Get Markov Namegen on GitHub or through haxelib, and read the documentation here.

Include it in your .hxml

-lib markov-namegen

Or add it to your Project.xml:

<haxelib name="markov-namegen" />

How It Works

The markov-namegen haxelib uses Markov chains to generate random words. Given a set of words as training data, the library calculates the conditional probability of a letter coming up after a sequence of letters chosen so far. It looks back up to "n" characters, where "n" is the order of the model.

The physics simulation is made using Nape, a 2D rigid body physics engine for Haxe. When balls containing topic words collide, balls are added to the simulation that contain new words generated using the training data for those topics.

The visualization is rendered using HTML5 with text, images and canvas elements, using absolute positioning for the balls. This is all kept in sync with the Nape physics simulation in a requestAnimationFrame loop.

Notes

License

The demo code is licensed under CC BY-NC. The haxelib library itself is MIT licensed. Training data was compiled from sites like Wikipedia and census data sources.