An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# Similarity dictionary

[![Build Status](https://travis-ci.org/saibot94/sim-dictionary.svg?branch=master)](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] 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:

```bash
python crawler_cli.py "Romanian"
```

or on Windows:

```powershell
python .\crawler_cli.py "Romanian"
```