Skip to content

Similarity based dictionary featuring a map of the world highlighting translations

License

Notifications You must be signed in to change notification settings

saibot94/sim-dictionary

Repository files navigation

Similarity dictionary

Build Status

Simple scraper / dictionary app with an intuitive interface.

Migrations

To run migrations, run:

alembic upgrade head

Endpoints

  • /api/translations/<word>: 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)

pipenv install

If any issues are encountered:

pipenv lock --pre --clear
pipenv install

To run:

FLASK_DEBUG=1 FLASK_APP="run.py" flask run --host 0.0.0.0

To run on windows (powershell):

 $env:FLASK_DEBUG=1; $env:FLASK_APP="run.py"; flask run

To add a new crawler:

  • in the crawlers module add a <language>_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:

usage: crawler_cli [-h] [--crawlers CRAWLERS] name

Seed things as fast as possible using this simple tool

positional arguments:
  name                 The name of the language

optional 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:

python crawler_cli.py "Romanian"

or on Windows:

python .\crawler_cli.py "Romanian"

About

Similarity based dictionary featuring a map of the world highlighting translations

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published