Git Product home page Git Product logo

define's Introduction

Define Build Status

Define is a terminal dictionary script that uses wordnik for definitions. Supports audio pronunciation

Example:

$define love

LOVE:

A deep, tender, ineffable feeling of affection and solicitude toward a person, such as that arising from kinship, recognition of attractive qualities, or a sense of underlying oneness.

INSTALLATION

Installing define is easy:

Using pip:

$ sudo pip install define

On Arch:

$ yaourt -S define

Manual Installation:

$ sudo python setup.py install You will need an api key from wordnik, get one from developer.wordnik.com and edit the "key" variable inside the script API key is now included in the script

Notes for Ubuntu 15.04 (may apply to other versions): To enable pip you'll need to add universe to your sources.

$ echo "deb http://archive.ubuntu.com/ubuntu/ vivid universe" | sudo tee -a "/etc/apt/sources.list"

$ sudo apt-get update

$ sudo apt-get install python-pip

To make use of audio feature if you install with pip. You'll need to install the gstreamer pacakge.

$ sudo apt-get install gstreamer1.0-tools

Using Audio

Audio can be used in define with the -a or --audio flag.

$ define --audio love

LOVE:

A deep, tender, ineffable feeling of affection and solicitude toward
a person, such as that arising from kinship, recognition of
attractive qualities, or a sense of underlying oneness.

Would you like to hear audio pronunciation? [Y/N] n

FLAGS

Define has the following flags:

-h/--help - Display help and exit.

-a/--audio - Audio pronunciation of keyword.

-t/--thesaurus - Thesaurus results for keyword.

-u/--urban - Search Urban Dictionary for results instead of Wordnik.

-l/--local - Search keywords using local dict and dictd dictionary (NOTE: This currently only works with the gcide dictionary, no other dictionary will work at the moment)

define's People

Contributors

coldsauce avatar professorjamesmoriarty avatar radek-sprta avatar sethdusek avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

define's Issues

HTTP use causes privacy issues

This software, needlessly, uses a website to define words. This is a privacy issue, for many obvious reasons. The first of which is a simple MITM attack, and the worst of which is data collected by the service used itself. There are, at least, access logs containing the users' IP addresses, and SethDusek5, himself, says that stats are collected on the words users define.

This also brings up issues where this project is wasting bandwidth, making HTTP requests when you could obviously just look for the definition in a file easily.

Way sound is being played is not compatible with every system.

I know this has been referenced in a previous issue: #5 however, the fix was add a dependency to an Arch package. For people installing this from source or people using operating systems where play is not available, that isn't an adequate fix.

Getting sound to work on every platform is a nightmare (I just tried :D ) I guess that's why libraries exist..

Here's a good page that lists a few external dependencies we could use to play sounds programatically.

https://wiki.python.org/moin/PythonInMusic

The program prints an error when no definition is found

The program prints out this error when the searched string has not been found on Wordnik.

Traceback (most recent call last):
  File "/usr/bin/define", line 24, in <module>
    print(rem[i].upper() + ": \n" + client.getDefinitions(rem[i])[0].text)
TypeError: 'NoneType' object has no attribute '__getitem__'

error

Audio does not work

I get this error whilst using the --audio flag:

bash: play: command not found

I suggest using mplayer, which can fetch the audio file by itself without the need of wget.
If mplayer is out of the question, fix the package dependencies.

HTTP issues

This issue is, actually, #16 , #22 and #23 but they were closed by the childish maintainer of this project. No need to add a proper description, just read those, other than #23 which was changed by the aforementioned childish maintainer.

API Keys

Your current code has API keys for services used, you should either remove all such items and services. This application is infringing on the rights of users. People want to be able to freely look up a term in a dictionary of their language. The best way to do this is to use the dictionaries already present on the system.

Do not use services that log requests made by users, and, certainly, not with your API keys. Your users are not you.

Language

In this code, it is assumed that the user wants the English definition. Perhaps this could be fixed by using the system dictionary?

Support for multiple definitions

Almost all words are not limited to one definition. And usually the Wordnik web-interface shows a few of them alongside with the corresponding part of speech. It would be nice for this program to do the same.

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.