Last active
October 29, 2018 17:56
-
-
Save shrey150/4fcc3e4d3f34af678c31da47d29df395 to your computer and use it in GitHub Desktop.
Plagarizer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "plagarizer", | |
| "version": "1.0.0", | |
| "description": "", | |
| "main": "main.js", | |
| "scripts": { | |
| "test": "echo \"Error: no test specified\" && exit 1" | |
| }, | |
| "author": "Shrey Pandya", | |
| "license": "MIT", | |
| "dependencies": { | |
| "datamuse": "^1.0.5" | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const datamuse = require("datamuse"); | |
| const s = "The quick brown fox jumps over the lazy dog"; | |
| async function makeSentence() { | |
| const arr = s.split(" "); | |
| for (const rawWord of arr) { | |
| const word = await getWord(rawWord); | |
| console.log(word); | |
| } | |
| } | |
| function shouldChangeWord() { | |
| } | |
| function getWord(word) { | |
| return new Promise((resolve, reject) => { | |
| datamuse.words({ | |
| ml: word | |
| }).then(res => { | |
| resolve(res[0]); | |
| }); | |
| }); | |
| } | |
| makeSentence(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment