Giter VIP home page Giter VIP logo

pylex's Introduction

PyLex

Python3 library for performing lexical analysis on words, one word at a time.

Usage

Help Usage

gavy42@jarvis:~/PyLex$ python3 script.py -h
usage: script.py [-h] [-r] [-s] [-a] [-m] [-hg] [-sa] [-n NUMBER] [-f]
                 word

PyLex: Perform lexical analysis, one word at a time.

positional arguments:
  word                  an input of the word

optional arguments:
  -h, --help            show this help message and exit
  -r, --rhyme           get rhyming words
  -s, --synonym         get synonym
  -a, --antonym         get antonyms
  -m, --meaning         get meaning
  -hg, --homographs     get homographs
  -sa, --sound_alike    get words that sound alike
  -n NUMBER, --number NUMBER
                        number of words should be returned
  -f, --full            FULL lexical analysis

Interpreter Usage

>>> from script import Lex
>>> lex = Lex("alone")
>>> lex
<script.Lex object at 0x7f8c075c5d68>
>>> wordlist = lex.rhyming_words()
[*] Getting rhyming words for the word: alone...
>>> lex.display_wordlist(wordlist, 4)
[*] Displaying list; Format: Descending
cologne
malone
overblown
blown

Functions Usage

After creating an object instance as Lex(<string>), these functions are available

  • rhyming_words() : Returns a list of words rhyming with the entered word.
  • synonyms() : Returns a list of synonyms
  • antonyms() : Returns a list of antonyms
  • meaning() : Returns a list of possible meanings
  • homophones() : Returns a list of homophones
  • homographs() : Returns a list of homographs
  • sound_alike() : Returns a list of words that sound alike the given word

PyLex Full Analysis

  • Run python3 script.py <word> -f to get full lexical analysis of any word.
  • Returns a JSON format file with contained information.
gavy42@jarvis:~/PyLex$ python3 script.py alone -f
[!][!] Starting full analysis of: alone

[*][*] JSON file saved in local directory named - alone_lex_analysis.json

Note

  • Program makes calls to external website to gather the information and scrapes content wherever needed.

Support

If you have any trouble understading some part of the code, feel free to raise an issue or for contributing, feel free to make a pull request.

pylex's People

Contributors

techcentaur 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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

pylex's Issues

missing packages

Add click and lxml to requirements.txt .
For ast I got an error, thus I had to remove it.
Also, add the shebang line to the beginning:

#!/usr/bin/env python3

Language support

Which languages are supported? And are there plans to role out the support?

EOL syntax error from JSON

I've been playing with the homophones() function and the API data does not copy correctly for URL. For example when I run.

lex = Lex("pop")
wordlist = lex.homophones()
print(lex)
lex.display_wordlist(wordlist, len(wordlist))

the output is as follows.

<script.Lex object at 0x024E0370>
EOL while scanning string literal (, line 1)

I've visited the webpage and there are four words, I'm just raising awareness. Sorry if the formatting is incorrect this is my first comment.

remove json from requirements.txt

$ python --version
Python 3.6.5
$ python -m pip install json
Collecting json
  Could not find a version that satisfies the requirement json (from versions: )

However, taking json out of requirements.txt fixes the issue.

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.