Last active
February 27, 2018 18:53
-
-
Save leblancfg/4eeb113c1f842093c2f011102f0a808e to your computer and use it in GitHub Desktop.
Synonyms CLI - Query a word's synonyms directly from terminal
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
# 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