https://github.com/saibot94/sim-dictionary
Similarity based dictionary featuring a map of the world highlighting translations
https://github.com/saibot94/sim-dictionary
dictionary flask pipenv python3 similarity-metric
Last synced: 2 months ago
JSON representation
Similarity based dictionary featuring a map of the world highlighting translations
- Host: GitHub
- URL: https://github.com/saibot94/sim-dictionary
- Owner: saibot94
- License: mit
- Created: 2019-06-12T17:09:50.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T05:48:29.000Z (almost 3 years ago)
- Last Synced: 2023-02-26T21:22:25.062Z (over 2 years ago)
- Topics: dictionary, flask, pipenv, python3, similarity-metric
- Language: Python
- Size: 98.6 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Similarity dictionary
[](https://travis-ci.org/saibot94/sim-dictionary)
Simple scraper / dictionary app with an intuitive interface.
## Migrations
To run migrations, run:
```bash
alembic upgrade head
```## Endpoints
- `/api/translations/`: get all the translations in all languages for a word
- `/api/translations?q=so*`: get all english words that can be used. You can search through them by using a * operator. Or something like `q=*o*`## Developing
Install all dependencies (will initiate a new virtualenvironment)
```bash
pipenv install
```If any issues are encountered:
```bash
pipenv lock --pre --clear
pipenv install
```To run:
```bash
FLASK_DEBUG=1 FLASK_APP="run.py" flask run --host 0.0.0.0
```To run on windows (powershell):
```powershell
$env:FLASK_DEBUG=1; $env:FLASK_APP="run.py"; flask run
```To add a new crawler:
- in the crawlers module add a `_crawler.py` file, which contains the crawler itself.
- in `__init__.py` follow the example: ``## Populating with data
Use the `crawler_cli.py` script in the root folder:
```text
usage: crawler_cli [-h] [--crawlers CRAWLERS] nameSeed things as fast as possible using this simple tool
positional arguments:
name The name of the languageoptional arguments:
-h, --help show this help message and exit
--crawlers CRAWLERS Module from where the crawlers should be loaded
```To populate the DB for a language based on the seed data:
```bash
python crawler_cli.py "Romanian"
```or on Windows:
```powershell
python .\crawler_cli.py "Romanian"
```