GenerateContent Wyam.TextGeneration

Procedurally generates content using flexible Rant text templates.

Package

This module exists in the Wyam.TextGeneration package which is not part of the core distribution. Add the following preprocessor directive to your configuration file to use it:
#n Wyam.TextGeneration
Alternativly, you can add all modules at once with the following preprocessor directive:
#n Wyam.All

Usage

  • GenerateContent(ContextConfig template)

    Uses a function to determine a text template which is processed and added as content for each document. This allows you to specify different content for each document depending on the context.

    • template

      A delegate that returns the template to use.

  • GenerateContent(DocumentConfig template)

    Uses a function to determine a text template which is processed and added as content for each document. This allows you to specify different content for each document depending on the input.

    • template

      A delegate that returns the template to use.

  • GenerateContent(params IModule[] modules)

    The specified modules are executed against an empty initial document and the resulting content from evaluating the entire child module chain is processed as a text template and added as content to each input document.

    • modules

      The modules to execute.

  • GenerateContent(object template)

    The specified text template is processed and added as content for every input document.

    • template

      The template to use.

Fluent Methods

Chain these methods together after the constructor to modify behavior.

  • IncludeNsfw(bool includeNsfw = true)

    Controls whether the dictionary will include NSFW content.

    • includeNsfw

      If set to true the dictionary will include NSFW content.

  • IncrementSeed(bool increment = true)

    Specifies whether to increment the seed for each document. If incrementing is not used, every document will get the same content for the same template.

    • increment

      If set to true the seed will be incremented for each document.

  • WithSeed(long seed)

    This allows you to set the seed used for text generation which can be handy for ensuring repeatable generations.

    • seed

      The seed to use.

GitHub