🔡
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. More Techniques

Generator Pools

Syllabore provides the convenience class GeneratorPool<T> for combining multiple name generators together.

Consider the following generator pool that creates both short and long names using different symbols:

var shortnames = new NameGenerator()
    .Any(x => x
        .First("str")
        .Middle("ou"))
    .SetSize(2);

var longnames = new NameGenerator()
    .Start(x => x
        .First("lmn")
        .Middle("ae'") // Note the apostrophe
        .Last("zs"))
    .Inner(x => x
        .CopyStart())
    .End(x => x
        .Middle("aeio"))
    .SetSize(3);

var pool = new GeneratorPool<string>()
    .Add(shortnames)
    .Add(longnames);

Calls to pool.Next() generates names like:

Toru
M'slazi
Ruso
Nesmezo

PreviousFormattersNextSyllable Sets

Last updated 2 months ago