From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,6e272adfef17f353 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-02-08 22:37:55 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!nycmny1-snh1.gtei.net!news.gtei.net!newsfeed.mathworks.com!wn13feed!worldnet.att.net!204.127.198.203!attbi_feed3!attbi.com!rwcrnsc54.POSTED!not-for-mail Message-ID: <3E45F778.9090403@attbi.com> From: "Robert I. Eachus" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.0.2) Gecko/20021120 Netscape/7.01 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Hi, I'm new to ADA References: <3E43DF55.DC92A8E8@bton.ac.uk> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: 24.62.164.137 X-Complaints-To: abuse@attbi.com X-Trace: rwcrnsc54 1044772675 24.62.164.137 (Sun, 09 Feb 2003 06:37:55 GMT) NNTP-Posting-Date: Sun, 09 Feb 2003 06:37:55 GMT Organization: AT&T Broadband Date: Sun, 09 Feb 2003 06:37:55 GMT Xref: archiver1.google.com comp.lang.ada:33931 Date: 2003-02-09T06:37:55+00:00 List-Id: 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... ;-)