poetry install
scripts/db_search_example.py
for a quick tutorial on how to use the database with SQLAlchemyThere are four main parts to the code:
DpdHeadwords
and DpdRoots
tables are the heart of the db, everything else gets derived from those. DpdHeadwords.rt.
to access any root information. For example, DpdHeadwords.rt.root_meaning
@properties
in db/models.py
to access useful derived information. DpdHeadwords
table also contains lists of inflections of every word in multiple scripts, as well as html inflection tables.FamilyCompound
table is html of all the compound words which contain a specific word. FamilyRoot
table is html of all the words with the same prefix and root. FamilySet
table is html of all the words which belong to the same set, e.g. names of monks. FamilyWord
table is html of all the words which are derived from a common word without a root. InflectionTemplates
table are the templates from which all the inflection tables are derived.
git submodule init && git submodule update
commandspoetry install
poetry run bash scripts/bash/initial_setup_run_once.sh
poetry run bash scripts/bash/build_db.sh
That should create an SQLite database ./dpd.db
which can be accessed by DB Browser, DBeaver, through SQLAlechmy or your preferred method.
For a quick tutorial on how to access any information in the db with SQLAlchemy, see scripts/db_search_example.py
.
⚠️ WARNING: When db/deconstructor/sandhi_splitter.py
runs with the config option deconstructor.all_texts = yes
, it will take several hours to complete.
Starting with a fresh clone of the tip:
git clone --depth=1 https://github.com/digitalpalidictionary/dpd-db.git
cd dpd-db
git submodule init && git submodule update
poetry install
poetry run bash scripts/bash/build_and_make_all.sh
This creates the dpd.db
SQLite database. Also it extract all dictionaries see folder exporter/share