Options
All
  • Public
  • Public/Protected
  • All
Menu

A markov chain generator that internally stores the parsed input tokens for later use.

Hierarchy

  • MarkovGenerator

Index

Constructors

Properties

Methods

Constructors

Properties

prefixes: string[] = []
suffixes: ISuffixMap = {}

Methods

  • generate(length: number): string
  • Generate an arbitrary amount of words based on the stored input tokens.

    Parameters

    • length: number

      The amount of words to generate.

    Returns string

    Generated text

  • parse(input: string, n?: number): void
  • Parse input into tokens and store them mapped to each other based on the window size.

    Parameters

    • input: string

      The input to parse.

    • n: number = 2

      The window size for parsing tokens.

    Returns void

Generated using TypeDoc