I wrote a Python program for writing bilingual dictionaries called
write_bilingual_dict.py. It is run from the command line like this:
python3 src/write_bilingual_dict.py <source language code> <target language code>
A practical example:
python3 src/write_bilingual_dict.py pandunia eng
With this command the program will read the files
dict/P/pandunia.tsv and
dict/E/eng.tsv. Then it combines together those rows that have the same concept id in the source language file and the target language file. Finally it writes a bilingual dictionary in the file
generated/pandunia-eng.md, which is a Markdown file. The file will look a below.
Code: Select all
## A
**argente** *n* silver
**aur** *n* gold
## B
**barka** *v* bless
**bina** *v* build
**brad** *n* brother
It would look like this in a website:
Markdown_formatter wrote:
A
argente n silver
aur n gold
B
barka v bless
bina v build
brad n brother
It doesn't look fancy but it does the job. Let's improve the program later to generate better looking dictionaries with more information about things like style, synonyms, morphology and etymology.
I wrote a Python program for writing bilingual dictionaries called [url=https://github.com/barumau/panlexia/blob/master/src/write_bilingual_dict.py]write_bilingual_dict.py[/url]. It is run from the command line like this:
python3 src/write_bilingual_dict.py <source language code> <target language code>
A practical example:
python3 src/write_bilingual_dict.py pandunia eng
With this command the program will read the files [i]dict/P/pandunia.tsv[/i] and [i]dict/E/eng.tsv[/i]. Then it combines together those rows that have the same concept id in the source language file and the target language file. Finally it writes a bilingual dictionary in the file [i]generated/pandunia-eng.md[/i], which is a Markdown file. The file will look a below.
[code]
## A
**argente** *n* silver
**aur** *n* gold
## B
**barka** *v* bless
**bina** *v* build
**brad** *n* brother
[/code]
It would look like this in a website:
[quote=Markdown_formatter]
[b]A[/b]
[b]argente[/b] [i]n[/i] silver
[b]aur[/b] [i]n[/i] gold
[b]B[/b]
[b]barka[/b] [i]v[/i] bless
[b]bina[/b] [i]v[/i] build
[b]brad[/b] [i]n[/i] brother
[/quote]
It doesn't look fancy but it does the job. Let's improve the program later to generate better looking dictionaries with more information about things like style, synonyms, morphology and etymology.