Giter Site home page Giter Site logo

tw1ddle / word-reactor Goto Github PK

View Code? Open in Web Editor NEW
5.0 4.0 1.0 18.34 MB

:8ball: A Markov process-based word generator inside a physics ballpool

Home Page: https://samcodes.co.uk/web/

License: Other

Haxe 0.45% HTML 0.03% JavaScript 99.52%
markov markov-chain markov-model markov-namegen markov-text random-generation random haxe html5 name-generation

word-reactor's Introduction

Project logo

License Build Status Badge

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.

word-reactor's People

Contributors

tw1ddle avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

3dhead

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.