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);Calls to names.Next() will produce names like:
Surunia
Timania
LisoniaUsing 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:
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:
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.
This results in names like:
Last updated