This simple generator emits short sentences based on the given text corpus using a Markov chain. To put it simply, it works kinda like word suggestions that you have while typing messages in your smartphone. It analyzes which word is followed by which in the given corpus and how often. And then, for any given word it tries to predict what the next one might be. Here you create an instance of TextGenerator passing an array of strings to it - it represents your text corpus which will be used to "train" the generator. The more strings/sentences you pass, the more diverse results you get, so you'd better pass like hundreds of them, or even more! If you have your texts in an external file, you can pass the path to it as an argument for TextGenerator's constructor.

Features

  • Get result as a raw array of strings
  • Read the text corpus from an external file
  • Simple generator that emits short sentences
  • Based on the given text corpus using a Markov chain
  • The smaller the number is, the more nonsense sentences you get
  • It analyzes which word is followed by which in the given corpus

Project Samples

Project Activity

See All Activity >

License

MIT License

Follow node-markov-generator

node-markov-generator Web Site

Other Useful Business Software
Contractor Foreman is the most affordable all-in-one construction management software for contractors and is trusted by contractors in more than 75 countries. Icon
Contractor Foreman is the most affordable all-in-one construction management software for contractors and is trusted by contractors in more than 75 countries.

For Residential, Commercial and Public Works Contractors

Starting at $49/m for the WHOLE company, Contractor Foreman is the most affordable all-in-one construction management system for contractors. Our customers in 75+ countries and industry awards back it up. And it's all backed by a 100 day guarantee.
Learn More
Rate This Project
Login To Rate This Project

User Reviews

Be the first to post a review of node-markov-generator!

Additional Project Details

Programming Language

TypeScript

Related Categories

TypeScript AI Text Generators, TypeScript Generative AI

Registered

2023-03-23