Coder Social home page Coder Social logo

nit-in / py-dictionary Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 1.0 26 KB

returns meaning, synonyms, antonyms for a word (scraping dictionary.com)

License: The Unlicense

Python 100.00%
antonyms synonyms py-dictionary python3 dictionary scrapy python-library english meaning

py-dictionary's Introduction

py-dictionary

returns meaning, synonyms, antonyms for a word (scraping dictionary.com) limit the no of results also get meaning, synonyms and antonyms in different color

This module uses requests, bs4 and string-color modules and scraps dictionary.com

How to use it

Install it

pip install Py-Dictionary

to update it

pip install Py-Dictionary --upgrade

Use

from pydictionary import Dictionary
dict = Dictionary("fix")

enter the word you want to search here e.g. I used the word "fix"

To get the result as list do following (you can use them in your programs)

meanings_list = dict.meanings()

synonyms_list = dict.synonyms()

antonyms_list = dict.antonyms()

To print the results do following:

dict.print_meanings()

dict.print_synonyms()

dict.print_antonyms()

This will print maximum 5 results with text having white color

If you want to increase or decrease maximum results do this

dict = Dictionary("fix",10)

now maximum 10 results will be shown

To change the color of text

dict.print_meanings("red")

dict.print_synonyms("green")

dict.print_antonyms("blue")

#To get more color look up string-color module or type string-color in your terminal

py-dictionary's People

Contributors

nit-in avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

sandy4321

py-dictionary's Issues

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.