Skip to content

Commit 75d9c38

Browse files
committed
Moved gitbook documentation into this repo
1 parent e3482df commit 75d9c38

19 files changed

Lines changed: 1206 additions & 3 deletions

docs/v3/SUMMARY.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Table of contents
2+
3+
* [Overview](README.md)
4+
* [Starting Out](starting-out.md)
5+
6+
## Fine-Tuning Generators
7+
8+
* [Positioning](fine-tuning-generators/positioning.md)
9+
* [Clusters](fine-tuning-generators/clusters.md)
10+
* [Weights](fine-tuning-generators/weights.md)
11+
* [Chancing](fine-tuning-generators/chancing.md)
12+
* [Transforms](fine-tuning-generators/transforms.md)
13+
* [Filtering](fine-tuning-generators/filtering.md)
14+
15+
***
16+
17+
* [More Techniques](more-techniques/README.md)
18+
* [Formatters](more-techniques/formatters.md)
19+
* [Generator Pools](more-techniques/joiners.md)
20+
* [Syllable Sets](more-techniques/syllableset.md)
21+
* [Generator Serialization](more-techniques/namegeneratorserializer.md)
22+
* [More Examples](more-examples/README.md)
23+
* [Soft/Hard-Sounding Names](more-examples/soft-hard-sounding-names.md)
24+
* [Fantasy Names](more-examples/fantasy-names.md)
25+
* [Spaceship Names](more-examples/spaceship-names.md)
26+
* [Futuristic City Names](more-examples/futuristic-city-names.md)
27+
28+
## Class Docs
29+
30+
* [FilterCondition](class-docs/filtercondition.md)
31+
* [FilterConstraint](class-docs/filterconstraint.md)
32+
* [GeneratorPool\<T>](class-docs/generatorpool-less-than-t-greater-than.md)
33+
* [INameFilter](class-docs/inamefilter.md)
34+
* [INameTransformer](class-docs/inametransformer.md)
35+
* [IPotentialAction](class-docs/ipotentialaction.md)
36+
* [IRandomizable](class-docs/irandomizable.md)
37+
* [ISyllableGenerator](class-docs/isyllablegenerator.md)
38+
* [Name](class-docs/name.md)
39+
* [NameFilter](class-docs/namefilter.md)
40+
* [NameFormat](class-docs/nameformat.md)
41+
* [NameFormatter](class-docs/nameformatter.md)
42+
* [NameFormatterGeneratorOptions](class-docs/nameformattergeneratoroptions.md)
43+
* [NameGenerator](class-docs/namegenerator.md)
44+
* [NameGeneratorSerializer](class-docs/namegeneratorserializer.md)
45+
* [NameGeneratorTypeInformation](class-docs/namegeneratortypeinformation.md)
46+
* [SerializedNameGenerator](class-docs/serializednamegenerator.md)
47+
* [SyllableGenerator](class-docs/syllablegenerator.md)
48+
* [SyllableGeneratorFluentWrapper](class-docs/syllablegeneratorfluentwrapper.md)
49+
* [SyllablePosition](class-docs/syllableposition.md)
50+
* [SyllableSet](class-docs/syllableset.md)
51+
* [Symbol](class-docs/symbol.md)
52+
* [SymbolGenerator](class-docs/symbolgenerator.md)
53+
* [SymbolPosition](class-docs/symbolposition.md)
54+
* [Transform](class-docs/transform.md)
55+
* [TransformSet](class-docs/transformset.md)
56+
* [TransformStep](class-docs/transformstep.md)
57+
* [TransformStepType](class-docs/transformsteptype.md)
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Chancing
2+
3+
By default, every syllable's symbol position (_first_, _middle_, and _last_) has a 100% chance of being included as long as there are symbols to use for that position.&#x20;
4+
5+
You can choose to change this probability to add more variety to your names. Consider the following generator:
6+
7+
```csharp
8+
var names = new NameGenerator()
9+
.Any(x => x
10+
.First("lmp")
11+
.Middle("aei")
12+
.Last("rst").Chance(0.5)) // 50% chance of using last position
13+
.SetSize(2, 3);
14+
```
15+
16+
<details>
17+
18+
<summary>See non-fluent version</summary>
19+
20+
```csharp
21+
var firstSymbols = new SymbolGenerator("lmp");
22+
var middleSymbols = new SymbolGenerator("aei");
23+
var lastSymbols = new SymbolGenerator("rst");
24+
25+
var syllableGenerator = new SyllableGenerator()
26+
.Add(SymbolPosition.First, firstSymbols)
27+
.Add(SymbolPosition.Middle, middleSymbols)
28+
.Add(SymbolPosition.Last, lastSymbols)
29+
.SetChance(SymbolPosition.Last, 0.5);
30+
31+
var names = new NameGenerator();
32+
names.SetSyllables(SyllablePosition.Any, syllableGenerator);
33+
names.SetSize(2, 3);
34+
```
35+
36+
</details>
37+
38+
Calls to `names.Next()` will generate names like:
39+
40+
```
41+
Matmali
42+
Lapis
43+
Parpite
44+
```
45+
46+
The `Chance()` method affects the last modified position and takes a value between 0.0 and 1.0 inclusive:
47+
48+
* 0.0 means the position should never have a symbol appear (0%)
49+
* 1.0 means the position should always have a symbol appear (100%)
50+
* Values in between represent a proportional percentage between 0% and 100%
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Clusters
2+
3+
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.
4+
5+
Clusters can be added using the `Cluster()` method. Consider the following generator:
6+
7+
```csharp
8+
var names = new NameGenerator()
9+
.Any(x => x
10+
.First(x => x
11+
.Add("str")
12+
.Cluster("sh", "th")) // Clusters must be separated with commas
13+
.Middle(x => x
14+
.Add("aeo")
15+
.Cluster("ou")));
16+
```
17+
18+
<details>
19+
20+
<summary>See non-fluent version</summary>
21+
22+
```csharp
23+
var consonants = new SymbolGenerator("str")
24+
.Cluster("sh", "th"); // Add consonant clusters
25+
26+
var vowels = new SymbolGenerator("aeo")
27+
.Cluster("ou"); // Add vowel clusters
28+
29+
var syllables = new SyllableGenerator()
30+
.Add(SymbolPosition.First, consonants)
31+
.Add(SymbolPosition.Middle, vowels);
32+
33+
var names = new NameGenerator()
34+
.SetSyllables(SyllablePosition.Any, syllables);
35+
```
36+
37+
</details>
38+
39+
In this example, the generator is given the following rules:
40+
41+
* Choose from 3 symbols and 2 clusters (`sh`,`th`) for the first position of _any_ syllable
42+
* Choose from 3 symbols and 1 cluster (`ou`) for the middle position of _any_ syllable
43+
* Don't use any symbol or cluster for the last position of a syllable
44+
45+
Calls to `names.Next()` will generate names like:
46+
47+
```
48+
Sashara
49+
Rousa
50+
Tethorou
51+
```
Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
# Filtering
2+
3+
### Filtering symbol combos
4+
5+
Generators let you block symbol combinations or patterns from showing up in names.&#x20;
6+
7+
Consider the following generator that does not create names with two consecutive `t` symbols: &#x20;
8+
9+
```csharp
10+
var names = new NameGenerator()
11+
.Any(x => x
12+
.First("st")
13+
.Middle("aeiou")
14+
.Last("st"))
15+
.Filter("tt"); // Prevent two t's in a row
16+
```
17+
18+
<details>
19+
20+
<summary>See non-fluent version</summary>
21+
22+
```csharp
23+
var consonants = new SymbolGenerator("st");
24+
var vowels = new SymbolGenerator("aeiou");
25+
26+
var syllableGenerator = new SyllableGenerator()
27+
.Add(SymbolPosition.First, consonants)
28+
.Add(SymbolPosition.Middle, vowels)
29+
.Add(SymbolPosition.Last, consonants);
30+
31+
var nameFilter = new NameFilter()
32+
.Add(new FilterConstraint(FilterCondition.MatchesPattern, "tt"));
33+
34+
var names = new NameGenerator()
35+
.SetSyllables(SyllablePosition.Any, syllableGenerator)
36+
.SetFilter(nameFilter)
37+
.SetSize(2, 3);
38+
```
39+
40+
</details>
41+
42+
✅This generator creates names like:
43+
44+
```
45+
Tostis
46+
Sastus
47+
Tessesos
48+
```
49+
50+
❌This generator will never create names like:
51+
52+
```
53+
Sottus
54+
Tottis
55+
```
56+
57+
### Filtering through regex
58+
59+
If you are comfortable using [regular expressions](https://en.wikipedia.org/wiki/Regular_expression), you can choose to use in your filter.
60+
61+
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:
62+
63+
```csharp
64+
var names = new NameGenerator()
65+
.Any(x => x
66+
.First("strlmn")
67+
.Middle("aeiou"))
68+
.Filter("^M|u$");
69+
```
70+
71+
<details>
72+
73+
<summary>See non-fluent version</summary>
74+
75+
```csharp
76+
var consonants = new SymbolGenerator("st");
77+
var vowels = new SymbolGenerator("aeiou");
78+
79+
var syllableGenerator = new SyllableGenerator()
80+
.Add(SymbolPosition.First, consonants)
81+
.Add(SymbolPosition.Middle, vowels)
82+
.Add(SymbolPosition.Last, consonants);
83+
84+
var nameFilter = new NameFilter()
85+
.Add(new FilterConstraint(FilterCondition.MatchesPattern, "^M|u$"));
86+
87+
var names = new NameGenerator()
88+
.SetSyllables(SyllablePosition.Any, syllableGenerator)
89+
.SetFilter(nameFilter)
90+
.SetSize(2, 3);
91+
```
92+
93+
</details>
94+
95+
This generates names like:
96+
97+
```
98+
Temaro
99+
Rima
100+
Narumi
101+
```
102+
103+
### Filtering multiple things at once
104+
105+
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`.
106+
107+
❌Don't do this if you want to filter multiple patterns:
108+
109+
```csharp
110+
var names = new NameGenerator()
111+
.Any(x => x
112+
.First("strlmn")
113+
.Middle("aeiou"))
114+
.Filter("^M")
115+
.Filter("u$")
116+
.Filter("le"); // Only the last filter gets applied
117+
```
118+
119+
✅Do this if you want to filter multiple patterns or combos at once:
120+
121+
```csharp
122+
var names = new NameGenerator()
123+
.Any(x => x
124+
.First("strlmn")
125+
.Middle("aeiou"))
126+
.Filter(x => x
127+
.DoNotAllowStart("m") // All of these get applied
128+
.DoNotAllowRegex("u$")
129+
.DoNotAllowSubstring("le"));
130+
```
131+
132+
This generates names like:
133+
134+
```
135+
Lisone
136+
Nara
137+
Ronimo
138+
```
139+
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Positioning
2+
3+
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. &#x20;
4+
5+
<div align="left"><figure><img src="../.gitbook/assets/image (5).png" alt="" width="188"><figcaption></figcaption></figure></div>
6+
7+
Consider the following example:
8+
9+
```csharp
10+
var names = new NameGenerator()
11+
.Start(x => x // The starting syllable of a name
12+
.First("st") // Leading consonants
13+
.Middle("eo") // Vowels
14+
.Last("mn")) // Trailing consonants
15+
.Inner(x => x // The "body" of a name
16+
.First("pl")
17+
.Middle("ia"))
18+
.End(x => x // The ending syllable of a name
19+
.CopyInner()) // Use the same symbols as inner syllables
20+
.SetSize(3); // Makes names 3 syllables long
21+
```
22+
23+
<details>
24+
25+
<summary>See non-fluent version</summary>
26+
27+
```csharp
28+
var startingSyllables = new SyllableGenerator()
29+
.Add(SymbolPosition.First, "st")
30+
.Add(SymbolPosition.Middle, "eo")
31+
.Add(SymbolPosition.Last, "mn");
32+
33+
var innerSyllables = new SyllableGenerator()
34+
.Add(SymbolPosition.First, "pl")
35+
.Add(SymbolPosition.Middle, "ia");
36+
37+
var names = new NameGenerator()
38+
.SetSyllables(SyllablePosition.Starting, startingSyllables)
39+
.SetSyllables(SyllablePosition.Inner, innerSyllables)
40+
.SetSyllables(SyllablePosition.Ending, innerSyllables)
41+
.SetSize(3);
42+
```
43+
44+
</details>
45+
46+
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.
47+
48+
Calls to `names.Next()` will generate names like
49+
50+
```
51+
Tonpali
52+
Sonlili
53+
Tenlipa
54+
```
55+
56+
{% hint style="info" %}
57+
The call to `SetSize(3)` forces all generated names to be exactly 3 syllables long.&#x20;
58+
{% endhint %}

0 commit comments

Comments
 (0)