> 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/class-docs/namegenerator.md).

# NameGenerator

Generates names by constructing syllables and joining them together.

*Implements: Archigen.IGenerator\<System.String>,* [*IRandomizable*](/syllabore/class-docs/irandomizable.md)

## Constructors

| Constructor                                                                                       | Description                                                                                                                                                                                                                                                                                                     |
| ------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| NameGenerator()                                                                                   | Initializes a new instance of the [NameGenerator](/syllabore/class-docs/namegenerator.md) class with no symbols, no transformer, and no filter.                                                                                                                                                                 |
| NameGenerator(System.String firstSymbols, System.String middleSymbols)                            | Initializes a new [NameGenerator](/syllabore/class-docs/namegenerator.md) with specified symbol pools for the first and middle symbol positions of a syllable. Each character in the provided strings is considered a separate symbol. The generated syllables will be used for all positions of a name.        |
| NameGenerator(System.String firstSymbols, System.String middleSymbols, System.String lastSymbols) | Initializes a new [NameGenerator](/syllabore/class-docs/namegenerator.md) with specified symbol pools for the first, middle, and last symbol positions of a syllable. Each character in the provided strings is considered a separate symbol. The generated syllables will be used for all positions of a name. |

## Methods

| Method                                                                                                                                                            | Returns                                                 | Description                                                                                                                                                                                         |
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Next()                                                                                                                                                            | System.String                                           | Generates a name and returns it as a string.                                                                                                                                                        |
| SetFilter([INameFilter](/syllabore/class-docs/inamefilter.md) filter)                                                                                             | [NameGenerator](/syllabore/class-docs/namegenerator.md) | Sets the name filter to use when generating names. Returns this instance of [NameGenerator](/syllabore/class-docs/namegenerator.md) for chaining.                                                   |
| SetSize(System.Int32 size)                                                                                                                                        | [NameGenerator](/syllabore/class-docs/namegenerator.md) | Sets both the minimum and maximum number of syllables to use per name. Returns this instance of [NameGenerator](/syllabore/class-docs/namegenerator.md) for chaining.                               |
| SetSize(System.Int32 minSize, System.Int32 maxSize)                                                                                                               | [NameGenerator](/syllabore/class-docs/namegenerator.md) | Sets the minimum and maximum number of syllables to use per name. Returns this instance of [NameGenerator](/syllabore/class-docs/namegenerator.md) for chaining.                                    |
| SetSyllables([SyllablePosition](/syllabore/class-docs/syllableposition.md) position, [ISyllableGenerator](/syllabore/class-docs/isyllablegenerator.md) generator) | [NameGenerator](/syllabore/class-docs/namegenerator.md) | Sets the [SyllableGenerator](/syllabore/class-docs/syllablegenerator.md) for the specified position. Returns this instance of [NameGenerator](/syllabore/class-docs/namegenerator.md) for chaining. |
| SetTransform([INameTransformer](/syllabore/class-docs/inametransformer.md) transformer)                                                                           | [NameGenerator](/syllabore/class-docs/namegenerator.md) | Sets the name transformer to use when generating names. Returns this instance of [NameGenerator](/syllabore/class-docs/namegenerator.md) for chaining.                                              |

## Properties

| Property           | Type                                                                                                                                                                    | Description                                                                                                                                                                                  |
| ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| MaximumRetries     | System.Int32                                                                                                                                                            | If this generator has a filter, this is the maximum attempts that will be made to satisfy the filter before an InvalidOperationException is thrown. The default maximum retry count is 1000. |
| MaximumSize        | System.Int32                                                                                                                                                            | The maximum number of syllables in generated names. The default maximum size is 3 syllables.                                                                                                 |
| MinimumSize        | System.Int32                                                                                                                                                            | The minimum number of syllables in generated names. The default minimum size is 2 syllables.                                                                                                 |
| NameFilter         | [INameFilter](/syllabore/class-docs/inamefilter.md)                                                                                                                     | The filter used to control generated names. Can be null if no filter is being used.                                                                                                          |
| NameTransformer    | [INameTransformer](/syllabore/class-docs/inametransformer.md)                                                                                                           | The transformer used to modify generated names. Can be null if no transform is being used.                                                                                                   |
| Random             | System.Random                                                                                                                                                           | The instance of *System.Random* used to simulate randomness.                                                                                                                                 |
| SyllableGenerators | System.Collections.Generic.Dictionary <[SyllablePosition](/syllabore/class-docs/syllableposition.md),[ISyllableGenerator](/syllabore/class-docs/isyllablegenerator.md)> | The [SyllableGenerator](/syllabore/class-docs/syllablegenerator.md) used by this [NameGenerator](/syllabore/class-docs/namegenerator.md).                                                    |
