/Zhudi

Zhudi is a graphical interface to xDICT range of free dictionaries written in GTK4

Primary LanguagePythonGNU Lesser General Public License v3.0LGPL-3.0

What is Zhudi?

Zhudi is a GTK4 graphical interface to the EDICT dictionaries. The following ones are included by default:

Features

What platforms are supported?

Since this project is written in Python 3.10+ & GTK4, it should be able to run on any given platform. However, I only have tested it under GNU/Linux (Gnome).

What are the dependencies of Zhudi?

In order to run Zhudi, you need the following packages:

  • python 3.10+
  • python-gobject
  • pygobject-devel
  • gobject-introspection

You also need to have GTK 4 installed.

Installation

Pip

Zhudi can be installed using python's package manager pip as follows:

pip install git+https://github.com/Jiehong/Zhudi

Launching

Run it by running the zhudi python module in the directory you installed it from:

cd /path/to/zhudi
python -m zhudi

You should see the GUI up and running:

GUI screenshot

Development

Locally, you can use poetry.

First time:

poetry install

Then:

poetry run python -m zhudi

Command line usage

You also have access to a limited command line search as follows:

$ zhu 我
我    ㄨㄛˇ    I
           ⇾ me

Unlike the GUI, this only provides the first and best match so far.

Unit tests

dict_test.u8 is used to test the splitting of the dictionary, and then for the rest of the unittests.

First, test that splitting the dictionary is working well:

poetry run python test_cli.py

Then, test the rest of the units:

poetry run python -m unittest

Formatting

Source files are formatted with black:

poetry run python -m black zhudi && poetry run python -m black tests

New Dictionaries

Download any EDICT dictionary with the *.u8 format, and modify db_fill.py to read it.

Then run:

poetry run python db_fill.py