Clusters
A symbol doesn't have to be a single character. Symbols with more than one character in them are called symbol clusters or just clusters for short.
Clusters can be added using the Cluster()
method. Consider the following generator:
var names = new NameGenerator()
.Any(x => x
.First(x => x
.Add("str")
.Cluster("sh", "th")) // Clusters must be separated with commas
.Middle(x => x
.Add("aeo")
.Cluster("ou")));
In this example, the generator is given the following rules:
Choose from 3 symbols and 2 clusters (
sh
,th
) for the first position of any syllableChoose from 3 symbols and 1 cluster (
ou
) for the middle position of any syllableDon't use any symbol or cluster for the last position of a syllable
Calls to names.Next()
will generate names like:
Sashara
Rousa
Tethorou
Last updated