🔡
Syllabore
GitHub
  • Overview
  • Starting Out
  • Fine-Tuning Generators
    • Positioning
    • Clusters
    • Weights
    • Chancing
    • Transforms
    • Filtering
  • More Techniques
    • Formatters
    • Generator Pools
    • Syllable Sets
    • Generator Serialization
  • More Examples
    • Soft/Hard-Sounding Names
    • Fantasy Names
    • Spaceship Names
    • Futuristic City Names
  • Class Docs
    • FilterCondition
    • FilterConstraint
    • GeneratorPool<T>
    • INameFilter
    • INameTransformer
    • IPotentialAction
    • IRandomizable
    • ISyllableGenerator
    • Name
    • NameFilter
    • NameFormat
    • NameFormatter
    • NameFormatterGeneratorOptions
    • NameGenerator
    • NameGeneratorSerializer
    • NameGeneratorTypeInformation
    • SerializedNameGenerator
    • SyllableGenerator
    • SyllableGeneratorFluentWrapper
    • SyllablePosition
    • SyllableSet
    • Symbol
    • SymbolGenerator
    • SymbolPosition
    • Transform
    • TransformSet
    • TransformStep
    • TransformStepType
Powered by GitBook
On this page
  • Generating simple names
  • Understanding symbols and syllables
  • Configuring symbols and syllables
  • Using the fluent API

Starting Out

PreviousOverviewNextPositioning

Last updated 1 month ago

See the 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 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 , , , or .

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:

Are some symbol positions optional?

All symbol positions are optional, but you'll want to supply at least one symbol for a position or you'll get empty strings for syllables.

Which syllable positions optional?

It depends on how many syllables there are in a name. In Syllabore:

  • A name that has 1 syllable only has a starting syllable

  • A name that has 2 syllables has a starting and ending syllable

How many inner syllables can there be?

If a name has more than 3 syllables then it has more than 1 inner syllable.

Configuring symbols and syllables

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 syllable

  • Use symbols a e o in the middle position of a syllable

  • Don'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

A is highly configurable. This is done by customizing its underlying and .

To fine-tune generators, read on to the next section which will cover techniques like , , , and .

NameGenerator
SymbolGenerators
SyllableGenerators
positioning
weights
transforms
filtering
installation guide
NameGenerator
positioning
weights
transforms
filtering