Zabolekar / jezik

Serbian dictionary with detailed information about accent
7 stars 0 forks source link

jèzik

Travis-CI Build Status

This will be a Serbian dictionary with detailed information about accent.

Screenshots

Example screenshot

Web instance

You can find a running instance of this thing at https://jezik.pythonanywhere.com/.

Requirements

We also use pytest to run the tests, mypy with types-PyYAML for static type checking, and coverage.py to measure test coverage, but they are not necessary to run the code.

Running it locally

To run the app locally for development purposes, do the following:

Using it without the web interface

You can use the underlying lookup function directly. It returns Multitable objects that can be queried in a flexible manner:

>>> lookup("ауторски")["nom sg"]
 [nom sg]
m sg nom            а̀уторскӣ
f sg nom            а̀уторска̄
n sg nom            а̀уторско̄

However, the output may be incorrect depending on your console font. We've found Noto Mono and Fira Code to work well.

Experimental GUI

A very incomplete GUI exists and can be started with python -m jezik.gui from outside the jezik directory.

Testing it locally

If the following commands give you errors, don't commit:

The following commands might give you some useful hints, but don't trust them blindly:

We also have configured pytest --quick to skip the most time-consuming tests but still perform the quick ones; this is useful during development.

You can measure test coverage like this:

coverage run -m pytest
# depending on what you want, add --branch after run and --quick after pytest
coverage report # for seeing a short report
coverage html # for generating a detailed report where you can browse files and see what wasn't executed

Don't let the results make you too optimistic. High coverage numbers can be reported even for files that don't have any automated tests at all (e.g. because some of their lines, like imports, class definitions, decorators etc. are executed during import).