kurwov
TypeScript icon, indicating that this package has built-in type declarations

3.2.4 • Public • Published

kurwov

A fast, dependency-free library for creating Markov Chains.

API

Generating a dataset.

import { MarkovData } from 'kurwov';
const sentences = ['i love hamburgers', 'i love cats'];
const data = new MarkovData(sentences);

Using your dataset to generate a sentence.

import { Markov } from 'kurwov';
Markov.generate({ data, length: 100 }); // i love hamburgers or i love cats

Adding an sentence to the dataset.

data.add('i love dogs');

Completing a sentence.

Markov.complete({ data, start: 'i love' }); // i love dogs, i love hamburgers, or i love cats

Features

Feature kurwov markov-typescript markov-generator markov-strings markov-chains
Dependency-free ✔️ ✔️
Typings ✔️ ✔️
Generating sentences ✔️ ✔️ ✔️ ✔️ ✔️
Completing sentences ✔️
Adding stuff other than strings ✔️ ✔️

Speed

kurwov speed over versions

Benchmark v1 v2 v3
Generating a dataset with 10000 sentences. 649.55ms 89.26ms 50.53ms
Generating a dataset with 100000 sentences. 25509.70ms 873.43ms 572.49ms

kurwov speed compared to other markov packages

Benchmark kurwov markov-typescript markov-generator markov-strings markov-chains
Generating a dataset with 10000 sentences. 50.53ms 419.66ms 346.16ms 1834.32ms N/A (errored)
Generating a dataset with 100000 sentences. 572.49ms 6221.28ms 28329.17ms N/A (couldn't finish in over 10 minutes) N/A (errored)

My other packages

Tiscord

Tisbench

Tisflake

Readme

Keywords

Package Sidebar

Install

npm i kurwov

Weekly Downloads

13

Version

3.2.4

License

Apache-2.0

Unpacked Size

19.4 kB

Total Files

6

Last publish

Collaborators

  • xiboon