Transforms

In Syllabore, a transform is any action that changes a name.

Using a basic transform

Consider the following generator that makes all names share the same suffix -nia:

var names = new NameGenerator()
    .Any(x => x                       // For all syllables...
        .First("lmnstr")              // Use these consonants
        .Middle("aeiou"))             // And these vowels
    .Transform(x => x.Append("nia"))  // Then add this suffix to the final name
    .SetSize(2);
See non-fluent version
var consonants = new SymbolGenerator("lmnstr");
var vowels = new SymbolGenerator("aeiou");

var syllables = new SyllableGenerator()
    .Add(SymbolPosition.First, consonants)
    .Add(SymbolPosition.Middle, vowels);

var step = new TransformStep(TransformStepType.AppendSyllable, "nia");
var transform = new Transform().AddStep(step);

var names = new NameGenerator()
    .SetSyllables(SyllablePosition.Any, syllables)
    .SetTransform(transform)
    .SetSize(2);

Calls to names.Next() will produce names like:

Surunia
Timania
Lisonia

Using a multistep transform

A transform is made up of transform steps. Steps are actions like:

  • Inserting, replacing, or deleting a syllable

  • Replacing a syllable or a substring

You are are allowed to have more than one step in a transform:

See non-fluent version

This generator creates names like:

Using a probabilistic transform

You can choose to add randomization to your transforms by using a TransformSet. Consider this generator:

See non-fluent version

This generator replaces the last syllable with one of the suffixes -des -rus or -vium. The names that come out of this generator look like this:

Chancing a transform

Finally, when using a TransformSet, you can also specify a probability of any transform being used through the Chance() method.

See non-fluent version

This results in names like:

Last updated