473,385 Members | 1,940 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Build a English-French dictionary in Java

Hi i'm actually doing some research on how to develop a dictionary English-French using Java. Can anyone help me please
Jan 5 '07 #1
3 3109
r035198x
13,262 8TB
Hi i'm actually doing some research on how to develop a dictionary English-French using Java. Can anyone help me please
Deepends on how far you are willing to go with it. A HashMap might be a starting point for a small program. You may also want to consider storing the words in a database.
Jan 5 '07 #2
DeMan
1,806 1GB
Assuming that you want to give word translation (that is if someone types in "yes" you give "oui" and some other synonyms) and that you are not, for example, trying to automate the translation of the entire Dickens collection, I would suggest something along the lines of <and yes this would be VERY timeconsuming>....

We're going to use a tree structure (i think they're called suffix trees and dictionary trees depending on where in the world you are <though, as always, I expect to be corrected if they're something else> and assume you only want eng-fra (if you want to go the other way you may have to do the same work again unless someone has a better idea)

Build a tree where each node has 27 children (more if you are interestend in hyphenated, accented or any othered words). The root node is unique and called (to be original) 'root' (or something equally as meaningful). The general idea is that each child represents a letter (with a leaf extension making the 27th node) so that (as an example) cat would follow from root-c-a-t-leaf. The leaf node, rather than containing children contains a container of the translations for the word we have reached. (I know my explanations aren't always clear so ask questions when you (or i) get confused).

Obviously not all the tree has to be implemented (so long as you have good checks to make sure hasChild('x') so that you don't need to create paths root-x-z-q-y-r-w-c-v-end.

A further optimization (which is not quite as easy as it sounds) is to store the maximum unique suffix string, ie if the only word in the english dictionary to begin aa were aardvark (and I'm not claiming it is) the path would be root-a-a-rdvark...That is you store the remainder of the string once it is unique. Personally, I think this is unnecessary these days when space is not a major issue in storage (though I'm sure others disagree, particularly in projects the scale of yours).

The advantage of using such a tree structure, is that it ,akes searching quite easy.....

if someone requests the word philanthropist you know to look down through p branch's h-branch etc (which is why you need a good test for "node doesn't exist <yet>).

I'm starting to confuse myself, so I've probably confused everyone else, but if you need some further explanation post back with what i haven't explained well enough and I'll see if I can do a better job
Jan 5 '07 #3
r035198x
13,262 8TB
Assuming that you want to give word translation (that is if someone types in "yes" you give "oui" and some other synonyms) and that you are not, for example, trying to automate the translation of the entire Dickens collection, I would suggest something along the lines of <and yes this would be VERY timeconsuming>....

We're going to use a tree structure (i think they're called suffix trees and dictionary trees depending on where in the world you are <though, as always, I expect to be corrected if they're something else> and assume you only want eng-fra (if you want to go the other way you may have to do the same work again unless someone has a better idea)

Build a tree where each node has 27 children (more if you are interestend in hyphenated, accented or any othered words). The root node is unique and called (to be original) 'root' (or something equally as meaningful). The general idea is that each child represents a letter (with a leaf extension making the 27th node) so that (as an example) cat would follow from root-c-a-t-leaf. The leaf node, rather than containing children contains a container of the translations for the word we have reached. (I know my explanations aren't always clear so ask questions when you (or i) get confused).

Obviously not all the tree has to be implemented (so long as you have good checks to make sure hasChild('x') so that you don't need to create paths root-x-z-q-y-r-w-c-v-end.

A further optimization (which is not quite as easy as it sounds) is to store the maximum unique suffix string, ie if the only word in the english dictionary to begin aa were aardvark (and I'm not claiming it is) the path would be root-a-a-rdvark...That is you store the remainder of the string once it is unique. Personally, I think this is unnecessary these days when space is not a major issue in storage (though I'm sure others disagree, particularly in projects the scale of yours).

The advantage of using such a tree structure, is that it ,akes searching quite easy.....

if someone requests the word philanthropist you know to look down through p branch's h-branch etc (which is why you need a good test for "node doesn't exist <yet>).

I'm starting to confuse myself, so I've probably confused everyone else, but if you need some further explanation post back with what i haven't explained well enough and I'll see if I can do a better job
Disappearing from the java forum and appearing at will won't help too much either. Nice to pop in though. You should do that more often though...

Interesting solution you have given there. I guess it depends on how far the OP is willing to take it or what his/her specs say. For example a tree data structure is already available in one of the java packages (java.util.TreeMap). The OP may decide to use it create their own tree. Or the OP might already have the words in some file and just wants to create an interface program that retrieves the words by making some kind of a mapping.


I trust your holidays were great.
Jan 5 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: BillKi | last post by:
I am working on localizing my webservice to return localized error messages to our client app. I have created 3 resx files, 1 for english (default), 1 for spanish, and 1 for italian. When I...
3
by: fragget | last post by:
where can i find a plugin that will automatically update the build number in vs.net? thx fg
2
by: Herve MAILLARD | last post by:
Hi, I need to have 2 (at least) different language in my C# app. What's the best way to do that ? Thanks for your help. H. MAILLARD
1
by: Vishal Saxena | last post by:
Hi, I am new to this news group, hope to get prompt solution from you, gurus of VC. Well i had a project developed in VC++ 6.0, it uses Adobe Plugin Development SDK, I am trying to upgrade my...
1
by: Wilfried Mestdagh | last post by:
Hi, I'm using C#2005 beta. In menu I find 'build solution' and also 'rebuild solution'. Can someone tell me the difference ? Because if you click again on 'build' then you do a rebuild not ? ...
9
by: dale zhang | last post by:
Hi, Anybody here has experience to build a english/chinese web? The chap 15 in Developing Web Applications tells sth about how to do this, but I want to know more details. It seems detect...
5
by: Bernhard Millauer | last post by:
hi! how to build a connection to a mssql db and how i get some data back with querys (with parameters) in a c#-webservice? and have i to include something for these steps? thx, Bernhard...
0
by: mlugo16 | last post by:
If you missed out on the DOT COM boom, now is your chance to cash in on the massive and growing global demand in our $20 BILLION PER YEAR market. We'll show you how to create an income that will...
7
by: HoldMyCorona | last post by:
I am loking to make changes on my site and I need someone that can assist me. Either i must be cheap or wanting to do it for experience please.. Also dont post chilish rants. I am asking nicely...
14
by: yxq | last post by:
Hello, I want to build the multi-language application with the xml file, how to do? could anyone tell a sample? Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.