ak-phrase
v1.0.6
Published
Generates all the permutations of sentences from words in a 2D array.
Downloads
7
Maintainers
Readme
ak-phrase
This library generates all the permutations of sentences using the words supplied in a 2D array.
It follows the word's order in a sentence, which is the same as the word's column order in an array.
Please consider donating, if you like my work.
Install
npm install ak-phrase
or
yarn add ak-phrase
Usage
const generateSentences = require('ak-phrase');
const wordArray = [
['eat'],
['code', 'commit'],
['sleep']
];
const sentences = generateSentences(wordArray);
console.log(sentences);
// Output:
// [ 'eat code sleep', 'eat commit sleep' ]
Contributing
Interested in contributing to this project? You can log any issues or suggestion related to this library here.
Read our contributing guide to get started with contributing to the codebase.
Contributors
Thank you to all the contributors who have helped us in making this project better 🙌