https://github.com/techcentaur/PyLex
Perform lexical analysis on words, one word at a time.
https://github.com/techcentaur/PyLex
cli lexical-analysis nlp poets python3 scraping words
Last synced: over 1 year ago
JSON representation
Perform lexical analysis on words, one word at a time.
- Host: GitHub
- URL: https://github.com/techcentaur/PyLex
- Owner: techcentaur
- License: mit
- Created: 2018-04-30T14:21:59.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2018-06-06T18:58:27.000Z (about 8 years ago)
- Last Synced: 2024-07-31T22:49:49.073Z (almost 2 years ago)
- Topics: cli, lexical-analysis, nlp, poets, python3, scraping, words
- Language: Python
- Homepage:
- Size: 29.3 KB
- Stars: 64
- Watchers: 5
- Forks: 2
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# PyLex
Python3 library for performing lexical analysis on words, one word at a time.
## Usage
#### Help Usage
```console
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
```python3
>>> from script import Lex
>>> lex = Lex("alone")
>>> lex
>>> 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()`, 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 -f` to get full lexical analysis of any word.
- Returns a JSON format file with contained information.
```console
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.