# SymbolGenerator

Generates random symbols from on a pool of weighted values.

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

## Constructors

| Constructor                            | Description                                                                                                                                                                                  |
| -------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| SymbolGenerator()                      | Instantiates a new [SymbolGenerator](https://sacro.gitbook.io/syllabore/class-docs/symbolgenerator).                                                                                         |
| SymbolGenerator(System.String symbols) | Instantiates a new [SymbolGenerator](https://sacro.gitbook.io/syllabore/class-docs/symbolgenerator) with the provided symbols. Each character in the string is considered a separate symbol. |

## Methods

| Method                             | Returns                                                                          | Description                                                                                                                                                                                                     |
| ---------------------------------- | -------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Add(System.String symbols)         | [SymbolGenerator](https://sacro.gitbook.io/syllabore/class-docs/symbolgenerator) | Adds the symbols in the provided string to this generator. Each character in the string is considered a separate symbol.                                                                                        |
| Cluster(System.String\[] clusters) | [SymbolGenerator](https://sacro.gitbook.io/syllabore/class-docs/symbolgenerator) | Adds provided symbol clusters (sequences) to this generator. Each argument regardless of its length is considered a single symbol.                                                                              |
| Copy()                             | [SymbolGenerator](https://sacro.gitbook.io/syllabore/class-docs/symbolgenerator) | Creates a deep copy of this [SymbolGenerator](https://sacro.gitbook.io/syllabore/class-docs/symbolgenerator) excluding the *Syllabore.SymbolGenerator.Random* property.                                         |
| Next()                             | System.String                                                                    | Returns a random [Symbol](https://sacro.gitbook.io/syllabore/class-docs/symbol) as a string. [Symbol](https://sacro.gitbook.io/syllabore/class-docs/symbol) with higher weights are more likely to be selected. |
| Weight(System.Int32 weight)        | [SymbolGenerator](https://sacro.gitbook.io/syllabore/class-docs/symbolgenerator) | Sets the weight of the most recently added symbols. This method should be called immediately after *Syllabore.SymbolGenerator.Add* or *Syllabore.SymbolGenerator.Cluster*.                                      |

## Properties

| Property | Type                                                                                             | Description                                                                                                          |
| -------- | ------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------- |
| Random   | System.Random                                                                                    | The instance of *System.Random* used to simulate randomness.                                                         |
| Symbols  | System.Collections.Generic.List <[Symbol](https://sacro.gitbook.io/syllabore/class-docs/symbol)> | The possible [Symbol](https://sacro.gitbook.io/syllabore/class-docs/symbol) that can be generated by this generator. |
