<div dir="ltr">Hello,<div><br></div><div>Great work, I have been thinking this for sometime. I am of the opinion that place names(towns / villages etc) should be translated and not transliterated. Arun has a point about locality address as people might be so used to English, that they find translations in their own language unusable.</div><div><br></div><div>For place names, would it be a good idea to run a script which can look up wikidata, extract names in multiple language and update OSM? Below is a sample query for 'Bangalore' in multiple languages.</div><div><br></div><div>[1] <a href="https://www.wikidata.org/w/api.php?action=wbgetentities&sites=enwiki&titles=Bangalore&languages=hi|ka|ml|ta|or|mr|gu|te&props=labels&format=xml">https://www.wikidata.org/w/api.php?action=wbgetentities&sites=enwiki&titles=Bangalore&languages=hi|ka|ml|ta|or|mr|gu|te&props=labels&format=xml</a></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Apr 4, 2015 at 11:54 PM, Aruna S <span dir="ltr"><<a href="mailto:safincrazy@gmail.com" target="_blank">safincrazy@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hello!<br><br></div><div>Long email warning.<br></div><div><br></div>I've been thinking a little bit about
 automating the translation of maps into multiple Indic languages ever since I saw the Kannada map at geoBLR in March.<br><br>I started some 
work on it today, and I have lots of interesting things to report. Right now I am mostly transliterating as opposed to translating but if a dictionary of common words/tags can be compiled, upgrading the script to translate instead of transliterating should be doable.<br></div><br></div><div>Here's the algorithm I followed:<br></div><ol><li>Get the nodes within a bounding box from OSM using the python wrapper for Overpass - <a href="http://python-overpy.readthedocs.org/en/latest/example.html" target="_blank">overpy</a> - This returns a collection of nodes and associated ID, tags, lat, lon and other attributes. This can also be repeated for ways by using the corresponding overpy query.<br></li><li>Filter nodes that have tags</li><li>From the result of the filter, identify nodes with Indic language tags - eg:["name:kn"]</li><li>Transliterate the string value for tag["name:kn"] to another language - I used Tamil - and store it within tag["name:ta"] - I used the <a href="http://silpa.org.in/Transliteration" target="_blank">Indic transliterator</a> <a href="http://transliteration.readthedocs.org/en/latest/" target="_blank">APIs from SILPA</a> for this</li><li>Create a new changeset and upload the result(node with tag["name:ta"]) to OSM using <a href="http://osmapi.divshot.io/#OsmApi.OsmApi.NodeUpdate" target="_blank">osmapi</a></li></ol><p>I did it only for one node: <a href="https://www.openstreetmap.org/edit?node=1118255762#map=19/12.99451/77.55430" target="_blank">https://www.openstreetmap.org/edit?node=1118255762#map=19/12.99451/77.55430</a><br></p><div><br></div><div><u>Advantages<br></u></div><div><ul><li><u><b>Indic to Indic transliterations - <span>✓</span></b></u>The Indic transliterator APIs seem to convert quite effortlessly from one Indic language to another. Right now, support is available for Hindi, Tamil, Punjabi, Gujarati, Malayalam, Oriya, Bengaliand Kannada. So, if a Kannada tag exists in OSM, the same text can be transliterated into multiple Indic languages using the naive algorithm I described above.<br></li></ul><p><u>Limitations</u></p><ul><li><u><b>English to Indic transliterations - X</b></u>: Though the Indic Transliterator works for English To Indic transliterations as well, it is not very useful. This is because only English words 
that are in the CMU dictionary are capable of being transliterated - 
which means that we can't transliterate "Raajaajeenagar", even if we had a custom tag for transliteration on OSM. On emailing the <a href="http://thottingal.in/blog/about/" target="_blank">developer</a> of the transliterator about extending the capabilities of English transliteration, I was told that extending the dictionary by adding additional words is one option. I am not sure of how feasible this is, or how much more optimal it is as compared to translating to one Indic language and transliterating+translating to the rest.<br></li><li><u><b>Translations of English Words - X</b></u> - Right now, I am only able to transliterate words, but if a list of common words(I am guessing all the OSM tags, and other common words) could be compiled, and translated into all the Indic languages, the translation process can be automated quite easily. This would require the algorithm to have 2 additional steps</li></ul><ol><ol><li>From an Indic tag(i.e., an already translated tag, we would have to identify portions that are in the translations list, and leave them out of the transliteration process.<br></li><li>For the word(s) identified in step 1, we must find a translation in the translations list for the language we are translating into. This must then be suffixed or prefixed with the transliterated portion. I am guessing suffix will be the norm, while prefixes might occasionally be necessary. <br></li></ol></ol><ul><li><u><b>Tracking node version numbers - X </b></u>- Right now, I am unable to track the version attribute of a node tag using the overpy API. I entered the version number manually. Not sure if I am missing something. This is just a "need-to-figure-out" issue more than anything. This is very important for automatically updating a node to the server because if there's a mismatch between the version number being passed to the API and the version number on the server, the API won't work.<br></li><li><u><b>Which Indic Language to <i>begin </i>transliterating in</b></u> - Issues might arise if a language like Tamil - where the letter for ka, kha, 
ga, gha etc is the same - is say used to transliterate to Hindi. But, if we use
 a language like Kannada or Hindi for the first time, this issue can 
probably be resolved easily.</li></ul><p>The <a href="https://github.com/anura28/Automate-Translations-OSM/blob/master/automateIndicTranslation.py" target="_blank">script is on Github</a>. Feel free to fork it, use it, work on it, edit it and suggest changes, different language, other possibilities, alternatives etc. Pull Requests very welcome. :)<br></p><p>This is my first time writing code in Python, so advice on improving code would be very welcome. Also, let me know if I'm missing something else, obvious or subtle. <br></p><p>Thanks!</p><p></p><p>Warmly,</p><p>Aruna<br></p></div></div>
<br>_______________________________________________<br>
Talk-in mailing list<br>
<a href="mailto:Talk-in@openstreetmap.org">Talk-in@openstreetmap.org</a><br>
<a href="https://lists.openstreetmap.org/listinfo/talk-in" target="_blank">https://lists.openstreetmap.org/listinfo/talk-in</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Regards<br>Srikanth.L</div>
</div>