> For the complete documentation index, see [llms.txt](https://sacro.gitbook.io/syllabore/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sacro.gitbook.io/syllabore/starting-out.md).

# Starting Out

See the [installation guide](/syllabore/readme.md) if you're looking to add Syllabore to your project for the first time.

If it's already added to your project, make sure the following directive near the top of the class file you're using generate names:

```csharp
using Syllabore;
```

## Generating simple names

Use the [NameGenerator](/syllabore/class-docs/namegenerator.md) class to generate names and call `Next()` to get new names. The following example creates a single name and prints it to the console:

```csharp
var names = new NameGenerator("str", "aeo");
Console.WriteLine(names.Next());
```

Each call to `names.Next()` will return names like:

```
Sasara
Rosa
Tetoro
```

To understand how generation works, continue reading below. If you want better control of generation, jump to the fine-tuning techniques like [positioning](/syllabore/fine-tuning-generators/positioning.md), [weights](/syllabore/fine-tuning-generators/weights.md), [transforms](/syllabore/fine-tuning-generators/transforms.md), or [filtering](/syllabore/fine-tuning-generators/filtering.md).&#x20;

## Understanding symbols and syllables

Names are made up of *syllables* which are in turn made up of *symbols*. Here's how the word `wonderful` can be broken down into symbols and syllables:

<div align="left"><figure><img src="https://189255252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBke4lr5BJ5EUHlOa4koh%2Fuploads%2F9fDZQnLIxb7hNB0LtYB3%2Fimage.png?alt=media&amp;token=cca3fe5b-cd56-468f-8f99-fec864f44252" alt="" width="375"><figcaption></figcaption></figure></div>

In Syllabore, names have three *syllable positions:*

* The **starting syllable**
* The **ending syllable**
* The **inner syllable**, which is always positioned between the starting and ending syllables

Inside a syllable, there are *symbol positions*:

* The **first symbol**
* The **last symbol**
* The **middle symbol,** which is always positioned in the "center" and usually a vowel

For example, here are the symbol positions in the word `dog`:

<div align="left"><figure><img src="https://189255252-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FBke4lr5BJ5EUHlOa4koh%2Fuploads%2FNzTosUwGqZA3IvPpAHtN%2Fimage.png?alt=media&amp;token=d2c7dc22-a132-423d-a4a0-a0e1656eb5c3" alt="" width="188"><figcaption></figcaption></figure></div>

<details>

<summary>Are some <em>symbol</em> positions optional?</summary>

All symbol positions are optional, but you'll want to supply at least one symbol for a position or you'll get empty strings for syllables.

</details>

<details>

<summary>Which <em>syllable</em> positions optional?</summary>

It depends on how many syllables there are in a name. In Syllabore:

* A name that has 1 syllable only has a *starting* syllable
* A name that has 2 syllables has a *starting* and *ending* syllable

</details>

<details>

<summary>How many inner syllables can there be?</summary>

If a name has more than 3 syllables then it has more than 1 *inner* syllable.

</details>

## Configuring symbols and syllables

A [NameGenerator](/syllabore/class-docs/namegenerator.md) is highly configurable. This is done by customizing its underlying [SymbolGenerators](/syllabore/class-docs/symbolgenerator.md) and [SyllableGenerators](/syllabore/class-docs/syllablegenerator.md).

Consider the following name generator.

```csharp
var names = new NameGenerator("str", "aeo");
```

This generator is setup with the following rules:

* Use symbols `s` `t` `r` in the first position of syllable
* Use symbols `a` `e` `o` in the middle position of a syllable
* Don't use anything for the last position of a syllable

Another way to configure this `NameGenerator` is to create the `SymbolGenerator` for its consonants and vowels first.&#x20;

```csharp
var consonants = new SymbolGenerator("str");
var vowels = new SymbolGenerator("aeo");

var syllables = new SyllableGenerator()
    .Add(SymbolPosition.First, consonants)
    .Add(SymbolPosition.Middle, vowels);

var names = new NameGenerator()
    .SetSyllables(SyllablePosition.Any, syllables);
```

In the example above, calls to `names.Next()` will also generate names like:

```
Sasara
Rosa
Tetoro
```

## Using the fluent API

Syllabore provides a fluent interface for configuring generators. This is optional and often cuts down on the amount of setup code.

To use the fluent interface, a class file must contain the following directive near the top of the file:

```csharp
using Syllabore.Fluent;
```

This will let you construct a name generator like so:

<pre class="language-csharp"><code class="lang-csharp"><strong>var names = new NameGenerator()
</strong>        .Any(x => x
        .First("str")
        .Middle("aeo"));
</code></pre>

In this fluent example, calls to `names.Next()` will once again generate names like:

```
Sasara
Rosa
Tetoro
```

To fine-tune generators, read on to the next section which will cover techniques like [positioning](/syllabore/fine-tuning-generators/positioning.md), [weights](/syllabore/fine-tuning-generators/weights.md), [transforms](/syllabore/fine-tuning-generators/transforms.md), and [filtering](/syllabore/fine-tuning-generators/filtering.md).&#x20;
