Giter Club home page Giter Club logo

synonym's Introduction

synonym

Find synonyms in 15 different languages directly from your terminal.


Synonym is a small utility tool to find synonyms directly from the command line.
It is using the thesaurus.altervista.org API to query for words.

List of supported languages:

en, fr, cs, el, es, da, de, hu, it, no, pl, pt, ro, ru, sk

synonym

What do you need?

API key

You will need to generate an API key to use this script, you can do so at https://thesaurus.altervista.org/mykey
You can sign in with either Facebook or Google.
After the sign in process you will be redirected to your API key.
Then, store your API key in your .synonymrc file.

Installation

Using Homebrew

brew tap smallwat3r/scripts \
  && brew install synonym

Manual install

To run synonym you will need to install jq

brew install jq          # macos
sudo apt-get install jq  # debian / ubuntu

then

git clone https://github.com/smallwat3r/synonym.git \
  && cd synonym && sudo make install

or (without cloning)

sudo wget https://raw.githubusercontent.com/smallwat3r/synonym/master/synonym \
    -P /usr/local/bin && sudo chmod 755 /usr/local/bin/synonym

Configuration file

You will need to create a .synonymrc config file in one of the locations below.

# Possible config file locations (by order of priority)

$XDG_CONFIG_HOME/.synonymrc
~/.config/.synonymrc
~/.synonymrc

In this file, you need to input your API key, and you can choose a default language.

# .synonymrc example

# API KEY https://thesaurus.altervista.org/mykey
SYNONYM_THESAURUS_KEY=<API KEY>

# Default language
# List of languages supported:
#   en, fr, cs, el, es, da, de, hu,
#   it, no, pl, pt, ro, ru, sk
SYNONYM_SEARCH_LANG=en

Note: if no language is set in .synonymrc, or specified in the parameters, the default language will be fetched from the current OS ($LANGUAGE or $LANG). If not supported by the API, or null, it will be set as default to en_US.

You are now all set to run synonym in your terminal.

How to use it?

$ synonym -h
Usage: synonym [OPTION] WORD

Finds synonyms for a given word in a specified language.
Run synonym -i for more information.

Options:
  -l LANG      Finds all synonyms for this specific language.
               Languages supported: en, fr, cs, el, es, da, de,
               hu, it, no, pl, pt, ro, ru, sk
  -h           Show help message and exit.
  -i           Show more help information and exit.
  -v           Show program version number and exit.

Examples

$ synonym happy
blessed         cheerful        elated          felicitous      glad            joyful          prosperous      well-chosen
blissful        content         euphoric        fortunate       golden          joyous          riant           willing 
bright          contented       felicitous      glad            halcyon         laughing        unhappy 

$ synonym -l fr joyeux
agréable        badin           content         éclatant        étincelant      hilarant        plaisant        ravi            rieur
aise            beau            désopilant      enchanté        fun             joie            plaisir         rayonnant       satisfait
allègre         brillant        distrayant      enjoué          gai             jovial          radiant         réjoui          spirituel
amusant         comblé          divertissant    ensoleillé      guilleret       jubilant        radieux         réjouissant
amusement       comique         drôle           épanoui         heureux         lumineux        rassasié        riant

$ synonym -l it allegro 
beato           felice          gaudioso        giocoso         gioviale        lieto
contento        gaio            giocondo        gioioso         ilare           raggiante

synonym's People

Contributors

smallwat3r avatar joeltari avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.