v2.0.1 Changelog
Provider Changes
- Grapheme positioning and clustering probabilities are now set by calling
WithProbability()
on a SyllableProvider
var g = new NameGenerator()
.UsingProvider(x => x
.WithVowels("ae")
.WithLeadingConsonants("str")
.WithTrailingConsonants("mnl")
.WithProbability(x => x
.LeadingConsonantExists(1.0)
.TrailingConsonantExists(0.20)));
- Weights can now be assigned directly to consonants and vowels to influence their frequency of use
var g = new NameGenerator()
.UsingProvider(x => x
.WithVowels("a").Weight(5) // This vowel will now occur 2.5 times more often than other vowels
.WithVowels("ei").Weight(2)
.WithConsonants("trs"));
Mutator (Transformer) Changes
- Name mutators have been reimplemented and are now called name
Transformers
. Similarly, Mutations are now Transforms
and MutationSteps are TransformSteps
.
- Transformation frequency is now set by calling
Select()
and Chance()
directly on a Transformer
- Weights can now be assigned to transforms to influence their frequency
var g = new NameGenerator()
.UsingProvider(x => x
.WithVowels("ae")
.WithLeadingConsonants("str"))
.UsingTransformer(x => x
.Select(1).Chance(0.5)
.WithTransform(x => x.AppendSyllable("gard")).Weight(2)
.WithTransform(x => x.AppendSyllable("dar")))
.UsingSyllableCount(3);
- Additionally, all
Transforms
are now serializable unless using ExecuteUnserializableAction()
Validator (Filter) Changes
- Name validators are now name
Filters
DoNotAllow()
, DoNotAllowEnding()
, DoNotAlllowBeginning()
methods have been added to filters as an alternative to providing regular expressions
var g = new NameGenerator()
.UsingFilter(x => x
.DoNotAllowEnding("j","p","q","w") // Invalidate these awkward endings
.DoNotAllowPattern(@"(\w)\1\1") // Invalidate any sequence of 3 or more identical letters
.DoNotAllowPattern(@"([^aeiouAEIOU])\1\1\1")); // Invalidate any sequence of 4 or more consonants
Serialization Changes
ConfigurationFile
has been replaced with class NameGeneratorSerializer
Minor changes
NameGenerator
LimitSyllableCount()
is now UsingSyllableCount()
- Added
SyllableSet
as first alternative to SyllableProvider
- Syllabore now uses Archigen