From: "Robert I. Eachus" <rieachus@attbi.com>
Subject: Re: Hi, I'm new to ADA
Date: Sun, 09 Feb 2003 06:37:55 GMT
Date: 2003-02-09T06:37:55+00:00 [thread overview]
Message-ID: <3E45F778.9090403@attbi.com> (raw)
In-Reply-To: N3S0a.25229$rq4.1907708@bgtnsc05-news.ops.worldnet.att.net
James S. Rogers wrote:
> You need to think about how to design a two-way look up table
> of words. You also need to think about how you will identify
> the language of the input sentence so that you will perform the
> correct translation. This can be complicated by the fact that
> English contains some French words, and modern French
> contains some English words.
I think Jim is envisioning some of the potential problems with what is
essentially the extra credit part of this assignment.
Completing the minimal assignment only requires a one-way map. In other
words every English word in the data structure must map to a specific
French word, but several English words can map to the same French word.
(For example hat = chapeau and cap = chapeau.)
So choose a data structure that allows insertions and (relatively) fast
lookup. If the assignment allows, I would use one of many existing Ada
implementations of AVL trees, B-trees, hash lists, etc. But if you do
choose an existing data structure library, I would document why you
chose that data structure. (Good practice for later on, but it will
also let the instructor know that you did give it some thought.)
If you want to do the more general assignment, I would create two
separate maps (English to French, and French to English) and insert new
word pairs in both. You can then choose some reasonable strategy for
dealing with duplicate entries like the chapeau example, and how to
determine whether a French to English translation is desired. (Ask the
user is probably a good strategy... ;-)
next prev parent reply other threads:[~2003-02-09 6:37 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-07 16:31 Hi, I'm new to ADA Paul Gregory
2003-02-07 17:31 ` James S. Rogers
2003-02-07 17:40 ` Vinzent Hoefler
2003-02-09 0:59 ` AG
2003-02-08 4:52 ` sk
2003-02-09 5:35 ` AG
2003-02-08 22:12 ` Avec son chapeau à la con (Was: Hi, I'm new to ADA) Ludovic Brenta
2003-02-09 6:37 ` Robert I. Eachus [this message]
2003-02-07 18:11 ` Hi, I'm new to ADA Preben Randhol
2003-02-07 18:37 ` Vinzent Hoefler
2003-02-08 10:25 ` Preben Randhol
2003-02-09 1:06 ` AG
2003-02-08 15:42 ` James S. Rogers
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox