Skip to content

Instantly share code, notes, and snippets.

@bengourley
Created April 23, 2014 15:38
Show Gist options
  • Save bengourley/11220370 to your computer and use it in GitHub Desktop.
Save bengourley/11220370 to your computer and use it in GitHub Desktop.
requirebin sketch
var thesaurus = require('thesaurus')
var words = 'Short tutorial on how to write like Russell Brand:\n\n1. Write an article\n2. Replace every word with a synonym from thesaurus.com'.split(' ')
console.log(words.map(function (word) {
var synonyms = thesaurus(word)
if (!synonyms.length) return word
return synonyms[0]
}).join(' '))
var thesaurus=require("thesaurus"),words="Short tutorial on how to write like Russell Brand:\n\n1. Write an article\n2. Replace every word with a synonym from thesaurus.com".split(" ");console.log(words.map(function(r){var e=thesaurus(r);return e.length?e[0]:r}).join(" "));
{
"name": "requirebin-sketch",
"version": "1.0.0",
"dependencies": {
"thesaurus": "0.0.0"
}
}
<style type='text/css'>html, body { margin: 0; padding: 0; border: 0; }
body, html { height: 100%; width: 100%; }</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment