> 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/namegeneratorserializer.md).

# NameGeneratorSerializer

A convenience class for reading and writing a [NameGenerator](/syllabore/class-docs/namegenerator.md) to disk and back.

## Constructors

| Constructor               | Description                                                                                                                |
| ------------------------- | -------------------------------------------------------------------------------------------------------------------------- |
| NameGeneratorSerializer() | Initializes a new [NameGeneratorSerializer](/syllabore/class-docs/namegeneratorserializer.md) with basic encoder settings. |

## Methods

| Method                                                                                               | Returns                                                 | Description                                                                                                                                                                                                                           |
| ---------------------------------------------------------------------------------------------------- | ------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Deserialize(System.String filepath)                                                                  | [NameGenerator](/syllabore/class-docs/namegenerator.md) | Reads a json file and turns it into a [NameGenerator](/syllabore/class-docs/namegenerator.md). This method expects the json file to have been written by the *Syllabore.Json.NameGeneratorSerializer.Serialize* method of this class. |
| Serialize([NameGenerator](/syllabore/class-docs/namegenerator.md) generator, System.String filepath) | System.Void                                             | Writes the specified [NameGenerator](/syllabore/class-docs/namegenerator.md) to a json file.                                                                                                                                          |

## Properties

| Property        | Type                                          | Description                                               |
| --------------- | --------------------------------------------- | --------------------------------------------------------- |
| EncoderSettings | System.Text.Encodings.Web.TextEncoderSettings | Allows characters and unicode ranges.                     |
| WriteIndented   | System.Boolean                                | If true, json output will be indented and easier to read. |
