• 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
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

Multiple Linguistic

 
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
I have a file which has english language text.I wish to open it ,
and convert it to an French language output.
and Display.
How do i code,what classes do i use???
-Navi
[This message has been edited by Navtaj Singh (edited March 15, 2001).]
 
"The Hood"
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not sure how to do this, but I KNOW that it can cause lot's of problems.
This is a post from Meaninless Drivel about a quote that was translated with no grammatical corrections done, and the result was a bit quirky .
http://www.javaranch.com/ubb/Forum32/HTML/000178.html
 
Navtaj Singh
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well that does not solve my problem, does it???
--Navi
 
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No, it doesn't. So? It's a tough problem, and no one is being paid to help anyone here. We're all volunteers. If someone has a good idea and feels like sharing it, then that's good. But it won't help any to be snippy about it if no one has a good idea - we just become less likely to want to help.
Having said that, a simple approach would be to use the java.util.Dictionary class. Get a big list of English -> French translations, and load them into the Dictionary. Read through your input file line by line, use a StringTokenizer (or StreamTokenizer) to separate the input into separate words. For each word, look up the translation in the dictionary, and spit the translation to an output file. This will in all likelihood giva an amazingly bad translation, but it's a start.
A more advanced attempt would be to replace the Dictionary with a more complex data structure which allows more than one translation for each word, and stores enough information about each possible translation to allow you to make a more educated guess about which translation is appropriate for a given context. You could base this choice on what types of other words are nearby - if the word is "bit" and nearby words are realated to computers, you can assume the computer science definition of a bit. If nearby words are relating to animals, you can assume "bit" is the past tense of "bite". But frankly, it's going to be a huge amount of work figuring out how to construct such a database intelligently, so I'll stop here. I suggest if you really want to get into this, you should go to www.google.com and type in "natural language processing", and start following links. The real work here has very little to do with particular pre-existing Java classes - it's understanding how language acutally works that is the challenge. Good luck.
 
Navtaj Singh
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh my god,i didn't know that my statement is so pinching.
What i meant was that i am still looking forward to a solution. AND NOT TO HURT ANYBODY'S FEELINGS!.
Anyways i still apologies if i have hurt anybody's feelings.
And thanks for the guidance.
I shall get back with more questions.
--Navi
 
Jim Yingst
Wanderer
Posts: 18671
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry; I guess I was feeling snippy myself. No harm done I hope. Good luck with the project.
 
Nothing? Or something? Like this tiny ad:
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!