Filtering
Filtering symbol combos
Generators let you block symbol combinations or patterns from showing up in names.
Consider the following generator that does not create names with two consecutive t symbols:
var names = new NameGenerator()
.Any(x => x
.First("st")
.Middle("aeiou")
.Last("st"))
.Filter("tt"); // Prevent two t's in a row✅This generator creates names like:
Tostis
Sastus
Tessesos❌This generator will never create names like:
Sottus
TottisFiltering through regex
If you are comfortable using regular expressions, you can choose to use in your filter.
The following generator uses the symbols m u, but uses a filter to prevent m from appearing at the beginning of a name and prevents u from ending it:
This generates names like:
Filtering multiple things at once
Calls to the fluent method Filter() implicitly sets a NameFilter on the NameGenerator you are setting up. There can only be one NameFilter on a NameGenerator.
❌Don't do this if you want to filter multiple patterns:
✅Do this if you want to filter multiple patterns or combos at once:
This generates names like:
Last updated