WIP — phono-word-gen

see the github repo for more information

see this page for code examples

Min/Max syllables/word
Number of Words
Number of Sentences
Generate words
Waiting for input...
Waiting for input...
Waiting for input...
Waiting for input...

Quick Docs

General

  • Comments: # comment ends at the end of the line

Phonology

  • Category: name = phoneme phoneme phoneme ...
  • Phonemes can be any character that is not whitespace or a semicolon
  • Using a category in a category: C = $A $B raw $D ...
  • Category reference loops are not allowed (e.g. C = p t $K; K = a b $C, V = a e $V o u, etc).

Syllable

  • Syllable definition: syllable: components...
  • Using categories in syllables: syllable: $C $V $N
  • Grouping components: syllable: {group}{$C$V}{}
  • Optional: syllable: (s)$C$V(n) Defaults to a 50% chance of appearing.
  • Selection: syllable: [$P,$F]r$V
  • Optional with weight: syllable: ($C)*5$V
  • Selection with weight: syllable: [$P,$F*3,{$K$L}*1]r$V

Named Components

  • Named component definition: component: name = syllableComponents...
  • You can use any valid syllable component as a named component.
  • Use a name component by using a percent sign before the name: %name
  • Named components can be used anywhere a syllable component can be used.
  • Named component reference loops are not allowed. For example: component: a = a %b; component: b = %a b (two components referencing each other), component: name = %name $C (component referencing itself).

Weighting Rules

  • Weights mark how often a component or phoneme can appear.
  • Weights are positive integers.
  • Weights can be applied to phonemes, optionals, or elements in a selection.
  • Phoneme weights are placed after the phoneme: C = p*1 t*3 k
  • Manually-marked weights on phonemes are carried over into any categories using that phoneme (i.e. P = p*4 k; C = $P t will have phoneme p have weight 4 in all categories).
  • Weighted optionals define what chance for that optional to appear (i.e. a weight of 33 means that it will appear ~33% of the time, 1 means 1%, etc).
  • Selection elements and phonemes without weights are defaulted to 1.

Rejections

  • Can reject a word based on category or phoneme
  • After reject: , place any series of components: reject: $C$V
  • You can have multiple reject: directives on multiple lines
  • Separate multiple rejects on the same line with vertical bar |, surrounding each with curly brackets: reject: $C$V|$V$V
  • Checking for components at the start and end of words is possible: reject: ^start|end&

Letters

  • Have a line with letters: to define a sort order for your words.
  • Each "letter" can have multiple characters.
  • Only the last letters: directive will be applied.

Changelog

  • v1.3: Add examples.
  • v1.2: Allow any non-raw-ending symbol as a phoneme.
  • v1.1.1: Fix named components having choice count of 0.
  • v1.1.0: Add named components.
  • v1.0.0: Go rewrite release. Word, sentence gen; rejections; sorting; syllable marking, etc.