Wednesday 21 July 2010

ベンゼン

Not sure of the title? Well if you knew Japanese you'd be ok. Since for some, or many of us, Japanese may not be the easiest of languages to pickup or understand, as an English speaker, I haven't got a clue what it means. Other than picking up a dictionary or attending some Japanese classes, you can use Google Translate. The advantage of Google Translate, is that it can convert between a multitude of different languages. If the suspense is killing you, the title actually means "Benzene".

I would be interested to see how well Google Translate works on other chemical names. If you're interested in converting say a batch load of names, there are Java and Python APIs available to access the web service.

Converting the name Benzene in English to its Romanian counterpart Benzen, works correctly.

Taking something more elaborate like: 13-amino-N-(2-{2-[(2-{[2-(2-aminoethyl)amino]ethyl}amino)ethyl]amino}ethyl)-
2,5,8,11-tetraazatridecanamide

returns -> 13-amino-N-(2 - (2 - [(2 - ([2 - (2-amino) etil] amino) amino) etil] amino) etil) -
2,5,8,11-tetraazatridecanamide

which I think is also right (with the exception of the loss in curly brace notation), though I will have to check.

Example Java code to translate

package eoc21;

import com.google.api.translate.Language;
import com.google.api.translate.Translate;

public class TranslateChemicalNames {

public static void main(String[] args) {
Translate.setHttpReferrer("en-fr");
try {
String translatedText = Translate.translate("tri-oxa-tri-silinane",
Language.ENGLISH, Language.ROMANIAN);
System.out.println(translatedText);
} catch (Exception ex) {
ex.printStackTrace();
}
}
}

1 comment:

  1. Interesting blog Ed and interesting post, there is lot of literature on this, have a look on this blog post
    http://www.abhishek-tiwari.com/2009/11/what-you-call-this-linguistic.html

    ReplyDelete