Starting Out
See the installation guide if you're looking to add Syllabore to your project for the first time.
If it's already added to your project, make sure the following directive near the top of the class file you're using generate names:
using Syllabore;
Generating simple names
Use the NameGenerator class to generate names and call Next()
to get new names. The following example creates a single name and prints it to the console:
var names = new NameGenerator("str", "aeo");
Console.WriteLine(names.Next());
Each call to names.Next()
will return names like:
Sasara
Rosa
Tetoro
To understand how generation works, continue reading below. If you want better control of generation, jump to the fine-tuning techniques like positioning, weights, transforms, or filtering.
Understanding symbols and syllables
Names are made up of syllables which are in turn made up of symbols. Here's how the word wonderful
can be broken down into symbols and syllables:

In Syllabore, names have three syllable positions:
The starting syllable
The ending syllable
The inner syllable, which is always positioned between the starting and ending syllables
Inside a syllable, there are symbol positions:
The first symbol
The last symbol
The middle symbol, which is always positioned in the "center" and usually a vowel
For example, here are the symbol positions in the word dog
:

Configuring symbols and syllables
A NameGenerator is highly configurable. This is done by customizing its underlying SymbolGenerators and SyllableGenerators.
Consider the following name generator.
var names = new NameGenerator("str", "aeo");
This generator is setup with the following rules:
Use symbols
s
t
r
in the first position of syllableUse symbols
a
e
o
in the middle position of a syllableDon't use anything for the last position of a syllable
Another way to configure this NameGenerator
is to create the SymbolGenerator
for its consonants and vowels first.
var consonants = new SymbolGenerator("str");
var vowels = new SymbolGenerator("aeo");
var syllables = new SyllableGenerator()
.Add(SymbolPosition.First, consonants)
.Add(SymbolPosition.Middle, vowels);
var names = new NameGenerator()
.SetSyllables(SyllablePosition.Any, syllables);
In the example above, calls to names.Next()
will also generate names like:
Sasara
Rosa
Tetoro
Using the fluent API
Syllabore provides a fluent interface for configuring generators. This is optional and often cuts down on the amount of setup code.
To use the fluent interface, a class file must contain the following directive near the top of the file:
using Syllabore.Fluent;
This will let you construct a name generator like so:
var names = new NameGenerator()
.Any(x => x
.First("str")
.Middle("aeo"));
In this fluent example, calls to names.Next()
will once again generate names like:
Sasara
Rosa
Tetoro
To fine-tune generators, read on to the next section which will cover techniques like positioning, weights, transforms, and filtering.
Last updated