Reputation: 79
I tried using indic-transliteration library but it doesnt work with marathi and the only other possible option I found was google translate API which has a lot of time lag.
I tried using this but my output is different with a "B"
import codecs,string
from indic_transliteration import sanscript
from indic_transliteration.sanscript import SchemeMap, SCHEMES, transliterate
def is_hindi(character):
maxchar = max(character)
if u'\u0900' <= maxchar <= u'\u097f':
return character
else:
print(transliterate(character, sanscript.ITRANS, sanscript.DEVANAGARI))
character = 'Bakrya vikne ahe'
is_hindi(character)
Output:
Bअक्र्य विक्ने अहे
Upvotes: 0
Views: 1210
Reputation: 5347
You can check out Polyglot. As far as transliteration it supports 69 languages.As per documentation it supports Marathi(#47).
There is one more older module.
Update:
with the given module try using lowercase
.There is no detailed explanation in the docs.
character = 'bakrya vikne ahe'
Upvotes: 0