Conversion_Kitchen_Code/kitchen_counter/conversion/translation/createDict.py

91 lines
1.6 KiB
Python
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import csv
from collections import OrderedDict
vowels = OrderedDict([
('','n'),
('','n'),
('','a'),
('','a'),
('','aa'),
('','i'),
('','ee'),
('','u'),
('','oo'),
('','ri'),
('','e'),
('','ae'),
('','o'),
('','au'),
('','a'),
('ि','i'),
('','i'),
('','u'),
('','oo'),
('','ri'),
('','e'),
('','ai'),
('','o'),
('','au')
])
consonants = OrderedDict([
('','k'),
('','kh'),
('','g'),
('','gh'),
('','ng'),
('','ch'),
('','chh'),
('','j'),
('ज़','z'),
('','z'), #these two are very different, see them in unicode by 'ज़'.encode('utf-8'). You'll see.
('','jh'),
('','nj'),
('','t'),
('','th'),
('','d'),
('ड़','r'),
('','r'), #these two are very different, see them in unicode by 'ड़'.encode('utf-8'). You'll see.
('','dh'),
('','n'),
('','t'),
('','th'),
('','d'),
('','dh'),
('','n'),
('','p'),
('','ph'),
('','f'),
('फ़','f'), #these two फ़ are very different, see them in unicode by 'फ़'.encode('utf-8'). You'll see.
('','b'),
('','bh'),
('','m'),
('','y'),
('','r'),
('','l'),
('','v'),
('','sh'),
('','sh'),
('','s'),
('','h'),
('क्ष','ksh'),
('त्र','tr'),
('ज्ञ','gy')
])
with open('svar.csv', 'w') as f:
csvwriter = csv.writer(f)
for k,v in zip(vowels.keys(), vowels.values()):
csvwriter.writerow([k,v])
with open('vyanjan.csv', 'w') as f:
csvwriter = csv.writer(f)
for k,v in zip(consonants.keys(), consonants.values()):
csvwriter.writerow([k,v])