• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Jj Roberts
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Himai Minh
  • Carey Brown
  • salvin francis

Language conversion in java

 
Ranch Hand
Posts: 172
Netbeans IDE MySQL Database Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all I'm developing a java application and all I wish to do is to convert the english string to Marathi language. How will it be possible?
 
Bartender
Posts: 10777
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Pranit Sonawane wrote:Hi all I'm developing a java application and all I wish to do is to convert the english string to Marathi language. How will it be possible?


Have a look at this.

Winston
 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "conversion" - translation of a text? Display of a text in different languages, like Winston assumed? Something else?
 
Pranit Sonawane
Ranch Hand
Posts: 172
Netbeans IDE MySQL Database Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Have a look at this.

Winston



no sir this is not I'm looking for

What do you mean by "conversion" - translation of a text? Display of a text in different languages, like Winston assumed? Something else?



Sir you are right...like we have google translating api...something like that I want. I tried including that jar file to the project but its not an open source now.
Any suggestions please?
 
Bartender
Posts: 2407
36
Scala Python Oracle Postgres Database Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Machine translation is a hard problem that people have been working on for decades. The most successful (or least useless) approach currently is based on statistical analysis of huge volumes of texts in different languages. In this approach, the program does not "understand" the source text at all, it just tries to predict the most probable equivalent string of words in the target language. Obviously, this requires a lot of computing resources. Google Translate is based on this approach and Google offers access to their API, but the processing runs on their servers because (a) it needs access to all those resources, and (b) Google has invested a lot of time and money in developing the system and they want to be able to control access in order to make money out of it.

How do you say "No such thing as a free lunch" in your language?
 
Ulf Dittmer
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If it's just words, then a translation API may not be what you need - a dictionary API might suffice (of which I'd guess are more out there, and there may even be downloadable ones that you can include in your app - but that's speculation on my part).
 
Marshal
Posts: 71051
291
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Tomorrow we have the “food, crafts and gift market” in the town centre. The Love [town name] website tells you all about it, and it uses Google translate to allow you to read the website in different languages. So I tried German where it proudly proclaims itself as

Essen Craft und Gift Markt - September

Any German speaker will tell you that “Craft” isn't actually a German word, the nearest being Kraft meaning strength/power. And “gift” in English translates as “Geschenk”; “Gift” in German means poison!
So you see that even the most sophisticated computerised translator still gets it horribly wrong, which gives you a hint at the difficulty of the whole procedure.

Anyway, this is far too difficult for us beginners, so I shall move the discussion.
 
Rancher
Posts: 1043
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Campbell Ritchie wrote:Tomorrow we have the "food, crafts and gift market" in the town centre.



As if the words "craft" and "gift", although rather common ones, were missing from the vocabulary and as if they were let alone as they are.
However if translated with http://translate.google.com as a separate entry, the title becomes correctly
Lebensmittel, Handwerk und Geschenk-Markt

This wonderful piece of translation yields a garbled sentence without actual meaning:

< The official guide to all that's great about Middlesbrough featuring what's on , shopping, eating out, nightlife, attractions and more!

> Der offizielle Leitfaden für alle, die große über Middlesbrough mit ist , was auf , Shopping , Essengehen , Nachtleben , Sehenswürdigkeiten und vieles mehr!

 
chris webster
Bartender
Posts: 2407
36
Scala Python Oracle Postgres Database Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ivan Jozsef Balazs wrote:
This wonderful piece of translation yields a garbled sentence without actual meaning...


Noam Chomsky got there first...
 
Campbell Ritchie
Marshal
Posts: 71051
291
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Geschenk‑Markt looks a lot better, even having the hypen in.
What did Chomsky say? I know he had something like

What annoyed Campbell was being ignored.

…as an example of an ambiguous sentence.
 
Campbell Ritchie
Marshal
Posts: 71051
291
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Earlier, I wrote: . . .
What did Chomsky say? . . .

Ah, yes, I recognise that nonsense sentence.
 
Ivan Jozsef Balazs
Rancher
Posts: 1043
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, the famous example "Colorless green ideas sleep furiously" makes perfect sense, it is a grammatical sentence,
you can translate it into a foreign language without difficulty (provided a sufficient level of language command of course).
Even though you could not fabricate a case when it is true, as this does not make semantical sense,
whereas it is completely grammatical. That is the point here.

However our gift market example lost the grammatical sense during the weary way of the machine translation.
I would not be able to translate that grammatically garbled sentence.

 
Winston Gutkowski
Bartender
Posts: 10777
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ivan Jozsef Balazs wrote:Even though you could not fabricate a case when it is true, as this does not make semantical sense,
whereas it is completely grammatical. That is the point here.


Although when Chomsky was writing it, I doubt whether the word "green", meaning "environmental", would have been in use. So perhaps we're a step closer to it actually appearing as a newspaper headline one day.

Winston
 
Ulf Dittmer
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
We're getting off track here, folks, let's keep this focused on the question at hand.
 
Winston Gutkowski
Bartender
Posts: 10777
71
Hibernate Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:We're getting off track here, folks, let's keep this focused on the question at hand.


Which I think has already been answered. However:

@Pranit: Just in case you were in any doubt, language translation is NOT an exact science; and certainly not a simple one (or indeed, one I'd attempt to "roll" myself).

There does appear to be a Java port of the Google translation API though, so if you really think you need to do this, I'd start there.

Winston
 
chris webster
Bartender
Posts: 2407
36
Scala Python Oracle Postgres Database Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A couple more points to remember if you are using an online translation API like Google Translate:

When you submit a text for translation by Google Translate, your text is copied to Google's servers for processing. They also store this material to feed into their statistical analysis for improving their translations in future. That's why they give you the option to "rate" the resulting translation, so they can estimate the most accurate translation of those words next time around. Of course, most people are using Google Translate because they don't know the other language well enough to translate it themselves, so they are not usually qualified to rate the translation anyway!

But this process of copying and storing your text means that if your text is covered by strict confidentiality requirements, you may be breaking those requirements by doing this. Some translation companies already warn their translators not to use Google Translate for this reason.

Another point is that these statistical translation tools work best where there is lots of matching material in the source and target languages. But for less common language pairs, this material is rarely available, so the tools may try to use another language as an intermediate step. For example, there is probably lots of material to support English --> Chinese translation, but there won't be much for Welsh --> Tibetan. So instead, the process may use Welsh --> English (lots of material available), English --> Chinese (lots of material) and Chinese --> Tibetan (probably a fair amount available). The problem is that each translation step introduces extra errors and noise, and the machine doesn't understand the texts anyway so it can't tell when it is producing worse results. So even if one translation step is 80% accurate on average (and that would be a pretty high standard for many texts), two steps are only 64% accurate, and three steps are only 51% accurate.

You can even test this for yourself. Pick a fairly obscure chunk of text in a language you understand, call this language A. Then use Google Translate to translate it from language A to another language B (one step), then from B to C (second step), and then from C to D (third step). Now translate from your final language D back to A. If the translation process is highly reliable, then the two versions of the text should match pretty closely. But depending on the nature of your text, and the intermediate languages, I would be surprised if this was really the case.

Speaking as a qualified (human) translator, I would advise you to be sceptical about using these translation tools for anything more than relatively simple texts in common language pairs. And even then, you probably need to have a good idea what the translation should look like if you want to avoid problems like Campbell's alarming "Gift Markt" ("Poison Market") above!
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic