Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
markov-chains-text
Advanced tools
Fake text, powered by Markov chains
markov-chains-text
is a simple, Markov chain-based text generator written in
JavaScript, and designed for both Node and the browser. It can be used to
generate random sentences modeled after a large corpus of text.
import { readFileSync } from 'fs';
import path from 'path';
import Text from 'markov-chains-text';
const MobyDick = readFileSync(path.join(__dirname, 'moby-dick.txt'));
// build the generator
const fakeMobyDick = new Text(MobyDick);
// generate a sentence
const sentence = fakeMobyDick.makeSentence();
console.log(sentence);
// Example output:
//
// And as the Porpoise is the harpooneer might be his immediate purpose,
// touching his own kith and kin to noble Benjamin--this day darting the
// barbed iron from one to the captain dared not attempt, he snatched the
// rope attached to it--for they were humbug.
//
markov-chains-text
relies on Maps and Generators, which are available
natively in Node v4.0 and above, and in modern versions of many browsers.
For a list of JavaScript environments that support these features, see the ECMAScript Compatability Table.
npm install --save markov-chains-text
import Text from 'markov-chains-text';
const fakeText = new Text(/* corpus: string */);
var Text = require('markov-chains-text').default;
var fakeText = new Text(/* corpus: string */);
Coming Soon
Pull requests are always welcome!
The following npm
scripts are available for use during development:
Command | Use to... |
---|---|
npm run clean | Remove the dist/ files |
npm run lint | Lint the files in src/ |
npm run build | Transpile the code with babel |
markov-chains-text
uses tape
for
testing.
To run the tests, just run npm test
at the command line.
markovify
- The excellent python
library that inspired markov-chains
markovchain-generate
markovchain
general-markov
markov
markov-chains-text
is licensed under the MIT License.
For details, please see the LICENSE
file.
FAQs
Fake text, powered by Markov chains
The npm package markov-chains-text receives a total of 15 weekly downloads. As such, markov-chains-text popularity was classified as not popular.
We found that markov-chains-text demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.