markov-namegen 1.0.4

Procedural word generation tool using a high order Markov process, back-off scheme, filtering and sorting

Released 2016-05-21.

To install, run:

haxelib install markov-namegen 1.0.4

See using Haxelib in Haxelib documentation for more information.

Current version1.0.4
StatisticsInstalled 57 times

Markov Namegen

Markov Namegen is a Markov chain-based word generator written in Haxe, made for procedural name generation. Try the demo out here.


  • Katz backoff using "high order" models - look up to "n" characters back.
  • Sort and filter generated strings by length, start, end and content.
  • Damerau-Levenshtein distance sort method.
  • Dirichlet prior parameter.


See the demo code for a complete worked example. Also read the documentation here.


  • The generator works by using Markov chains, and requires training data to build them. A hundred or more words within your chosen category is usually sufficient for good results.
  • Sort words by similarity to preferred "good words" using an edit distance metric, and pick the most similar and suitable results. There are a few edit distance measures provided in EditDistanceMetrics.hx.
  • To get best results the training dataset, model order and prior will need to be tweaked for the type of words you want to generate. If possible, keep the prior parameter low or zero. Filter words to suit: look at length, beginning, end, contents, edit distance limits. Some of this done for you in NameGenerator.hx. If you prefer to do it your own way, subclass the Generator class.


  • Many of the concepts used for the generator were suggested in this article by Jeffrey Lund.
  • The haxelib supports every Haxe target.
  • If you have any questions or suggestions then get in touch or open an issue.