Code Monkey home page Code Monkey logo

markovnamegenerator's Introduction

Project logo

Markov Namegen is a Markov chain-based procedural name generator written in Haxe. Try it now in your browser.

Demonstrates the markov-namegen haxelib. Read the library documentation here.

Features

  • Dozens of editable training data presets.
  • Configurable corpus, order and prior model parameter settings.
  • Filter results by length, start, end and content.
  • Sort by Damerau-Levenshtein distance to list results by similarity.
  • Save and share custom data, settings and results with one click.

Usage

Try the demo to generate your own words. For example:

Training Dataset: English Towns
Order: 5
Prior: 0.01
Max Processing Time: 500ms
Length: 8-12
Starts with: b
Ends with:
Include: ham
Exclude:
Similarity To: birmingham

A list of up to 100 results will be displayed. Here are the first 10 results from this run:

Barkingham
Basingham
Birkenham
Bebingham
Bollingham
Bridlingham
Billenham
Berwickham
Botteringham
Bradnincham

You can save or share custom training data, settings and results - simply hit one of the sharing buttons and and use the generated URL. Note that large training data sets generate URLs too long for some browsers and servers - reduce the amount of training data to work around this.

Install

Get the Haxe library from GitHub or through haxelib.

Include it in your .hxml

-lib markov-namegen

Or add it to your Project.xml:

<haxelib name="markov-namegen" />

Screenshots

Here is the demo in action:

Screenshot

Screenshot

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 generator can use several orders of models, each with memory n. Starting with the highest order models (models with bigger memories), it tries to get a new character, falling back to lower order models if necessary - this approach is known as Katz's back-off model.

A Dirichlet prior is also used, which adds a constant probability that any letter may be picked as the next letter, which acts as an additive smoothing factor and adds a bit more "randomness" to the generated output.

Loads of words are generated, and are filtered and sorted according to several tweakable criteria like length, start and end characters, similarity to a target word, and so on.

Notes

License

The website and demo code are licensed under CC BY-NC. The haxelib library itself is MIT licensed. The noUiSlider settings sliders are WTFPL. Most of the training data was compiled from sites like Wikipedia and census data sources.

markovnamegenerator's People

Contributors

tw1ddle avatar

Watchers

James Cloos avatar Aleksey avatar

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.