🔡
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
  1. Fine-Tuning Generators

Positioning

PreviousStarting OutNextClusters

Last updated 1 month ago

Any name or word is made up of syllables which are in turn made up of symbols. In Syllabore, you control which symbols to use for each syllable position of a name.

Consider the following example:

var names = new NameGenerator()
    .Start(x => x     // The starting syllable of a name
        .First("st")  // Leading consonants
        .Middle("eo") // Vowels
        .Last("mn"))  // Trailing consonants
    .Inner(x => x     // The "body" of a name
        .First("pl")
        .Middle("ia"))
    .End(x => x       // The ending syllable of a name
        .CopyInner()) // Use the same symbols as inner syllables
    .SetSize(3);      // Makes names 3 syllables long
See non-fluent version
var startingSyllables = new SyllableGenerator()
    .Add(SymbolPosition.First, "st")
    .Add(SymbolPosition.Middle, "eo")
    .Add(SymbolPosition.Last, "mn");

var innerSyllables = new SyllableGenerator()
    .Add(SymbolPosition.First, "pl")
    .Add(SymbolPosition.Middle, "ia");

var names = new NameGenerator()
    .SetSyllables(SyllablePosition.Starting, startingSyllables)
    .SetSyllables(SyllablePosition.Inner, innerSyllables)
    .SetSyllables(SyllablePosition.Ending, innerSyllables)
    .SetSize(3);

This generator will only use 7 symbols for the starting syllable of a name and then a different set of 4 symbols for the inner or ending syllable.

Calls to names.Next() will generate names like

Tonpali
Sonlili
Tenlipa

The call to SetSize(3) forces all generated names to be exactly 3 syllables long.