Mother Tongues Dictionaries dictionary creation tool
Mother Tongues Dictionaries (MTD)
This repo is under construction and could change drastically in the coming months with breaking changes.
MTD is the first of two open-source tools that allow language communities and developers to quickly and inexpensively make their dictionary data digitally accessible. MTD is a tool that parses and prepares your data for being used with an MTD UI.
Table of Contents
This project started as just a single dictionary for Gitxsan - a language spoken in Northern British Columbia, but it became quickly apparent that many communities also had the same problem. That is, they had some dictionary data but all of the options for sharing that data online were prohibitively expensive. MTD aims to make it easier to create online digital dictionary resources.
Note - Just because you can make an online dictionary does not mean you should. Before making a dictionary, you must have clear consent from the language community in order to publish a dictionary. For some background on why this is important, please read sections 1 and 2.1 here
It is recommended to install mothertongues using pip. The package name is
mothertongues, but it is imported as
mtd and the CLI can be run using either
pip install mothertongues
In order to create a Mother Tongues Dictionary you will need at least two things:
- A configuration file for you language/dictionary
- A configuration file for each source of data
You can find out more about how to create these files against the MTD configuration schema by visiting the docs
Once you have those files, you can either create a dictionary programatically or using the command line interface.
Using Python directly
from mtd import create_dictionary dictionary = create_dictionary(PATH_TO_LANGUAGE_CONFIG) # write a file containing configuration information config_js = dictionary.return_formatted_config(form='js') with open('config.js', 'w', encoding='utf8') as f: f.write(config_js) # write a file containing lexical data dict_cached_js = dictionary.return_formatted_data(form='js') with open('dict_cached.js', 'w', encoding='utf8') as f: f.write(dict_cached_js)
The two files that are then created above (
dict_cached.js) can be dropped into any MTD-UI to build a dictionary.
Using the CLI
You can either export your dictionary as a static site:
mtd export <PATH_TO_LANGUAGE_CONFIG> web <OUTPUT_DIR>
Or, you can build it first:
mtd prepare <PATH_TO_LANGUAGE_CONFIG>
And then serve it locally:
If something is not working, or you'd like to see another feature added, feel free to dive in! Open an issue or submit PRs. Help writing and clarifying documentation is also very welcome.
This repo follows the Contributor Covenant Code of Conduct.
Thank you to both Patrick Littell & Mark Turin for their contributions, guidance and support as well as institutional support from the First Peoples' Cultural Council and SSHRC Insight Grant 435-2016-1694, ‘Enhancing Lexical Resources for BC First Nations Languages’.
Thank you to all other contributors for support with improving MotherTongues, finding bugs and writing documentation.
This project exists thanks to all the people who contribute.
Release history Release notifications | RSS feed
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size mothertongues-0.18.20200711-py3-none-any.whl (6.7 MB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size mothertongues-0.18.20200711.tar.gz (756.0 kB)||File type Source||Python version None||Upload date||Hashes View|
Hashes for mothertongues-0.18.20200711-py3-none-any.whl
Hashes for mothertongues-0.18.20200711.tar.gz