REST API

This guide documents the REST interface of Brahminet for transliteration and script conversion. A sample Python client for consumption of the service is also shown.

Getting started with the API is easy! Copy the following URL to the browser:
http://www.cfilt.iitb.ac.in/indicnlpweb/indicnlpws/transliterate/en/hi/braahmi/statistical

You will see a JSON object which shows how the word Brahmi is written in Hindi.
{
    "hi": [
        "ब्राह्मी"
    ]
}

In general, a request to the API has the following format:
http://www.cfilt.iitb.ac.in/indicnlpweb/indicnlpws/<operation>/<src_lang>/<tgt_lang>/<source_string>/<method>/<top-k> 

The parameters to the REST request are described below: The REST request returns a JSON object, which contains a dictionary from target language to list of candidate translations.

Language Codes

Language CodeLanguage
asAssamese
bnBengali
enEnglish
guGujarati
hiHindi
knKannada
kKKonkani
mlMalayalam
mrMarathi
neNepali
orOdia
paPunjabi
saSanskrit
sdSindhi
siSinhala
taTamil
teTelugu
urUrdu

Examples

Transliteration of multiple token named entities

http://www.cfilt.iitb.ac.in/indicnlpweb/indicnlpws/transliterate_bulk/en/hi/los%20angeles/statistical
Output:
{
    "hi": [
        "लॉस एंजेल्स"
    ]
}

Obtaining the top-k candidates

http://www.cfilt.iitb.ac.in/indicnlpweb/indicnlpws/transliterate_bulk/en/hi/tirupur/statistical/5
Output:
{"hi":["तिरुपुर","तिरुपूर","तिरुपुरी","तिरुपुड़","तिरुपुड"]}

Example Python client

# -*- coding: utf-8 -*-

import urllib2
import django.utils.encoding
from django.utils import http

text=django.utils.encoding.iri_to_uri(http.urlquote('मद्रास'))
url=u' http://www.cfilt.iitb.ac.in/indicnlpweb/indicnlpws/transliterate_bulk/hi/en/{}/rule'.format(text)
response=urllib2.urlopen(url).read()
print response
Output:
{"en":["madrAsa"]}