Skip to content

Instantly share code, notes, and snippets.

@leblancfg
Last active February 27, 2018 18:53
Show Gist options
  • Save leblancfg/4eeb113c1f842093c2f011102f0a808e to your computer and use it in GitHub Desktop.
Save leblancfg/4eeb113c1f842093c2f011102f0a808e to your computer and use it in GitHub Desktop.
Synonyms CLI - Query a word's synonyms directly from terminal
# Always feeling like I'm repreating myself when writing prose,
# but forcing myself to stay in terminal
# Usage: syn $WORD, e.g. `syn car`
# Output: ['motor', 'automotive', 'cart']
# Requirements: Python 3+, pip install vocabulary
function syn () { python -c "import json;from pprint import pprint;from vocabulary.vocabulary import Vocabulary as vb;syns = json.loads(vb.synonym('$@'));pprint([s['text'] for s in syns]);" ; }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment