-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlanguage_conversion.py
37 lines (33 loc) · 966 Bytes
/
language_conversion.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# from gtts import gTTS
convert_word_to_hindi = {
"and" : "aur ",
"one" : "ek",
"two" : "do",
"three": "teen",
"four": "chaar",
"five" : "paanch",
"six" : "chhah",
"seven" : "saat",
"eight": "aath",
"nine" : "nau",
"10Rupees": "das rupaye ",
"20Rupees": "bees rupaye ",
"50Rupees": "pachaas rupaye ",
"100Rupees": "ek sau rupaye ",
"200Rupees": "do sau rupaye ",
"500Rupees": "paanch sau rupaye ",
"Notes": "ke not ",
"Note" : "ka not ",
}
def convert_lang(text):
res = ""
if(text == "Reload the page and try with another better image"):
res = "Page ko punah lod karo aur ek aur behatar chhavi ke saath prayaas karo"
else:
wordArr = list(text.split(' '))
res = "is chhavi mein "
for word in wordArr:
if(word in convert_word_to_hindi):
res += convert_word_to_hindi[word]
res += "hai"
return res