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,c3155860644be062 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-02-25 00:45:49 PST Message-ID: <3E5B2D24.3090504@epfl.ch> Date: Tue, 25 Feb 2003 09:45:24 +0100 From: =?ISO-8859-1?Q?Rodrigo_Garc=EDa?= User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:0.9.9) Gecko/20020513 X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Thanks guys..my project and my many problems References: <3E5A2381.21FD3F14@bton.ac.uk> <1046101109.45189@master.nyc.kbcfp.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit NNTP-Posting-Host: lglpc31.epfl.ch X-Trace: epflnews.epfl.ch 1046162744 128.178.76.8 (25 Feb 2003 09:45:44 +0200) Organization: EPFL Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!colt.net!easynet-quince!easynet.net!nntp.theplanet.net!inewsm1.nntp.theplanet.net!zen.net.uk!news.imp.ch!news.imp.ch!news-zh.switch.ch!epflnews.epfl.ch!not-for-mail Xref: archiver1.google.com comp.lang.ada:34549 Date: 2003-02-25T09:45:24+01:00 List-Id: Hyman Rosen wrote: > Paul Gregory wrote: > >> type English is (big, black, cat, dog, es, small, the, white); >> type French is (grand, noir, chat, chien, est, petit, le, blanc); > > > This is the core of your difficulties. Since the dictionary is > meant to be extensible (as you yourself have noticed), using > enumerations to encode the words is inappropriate - these types > are fixed at compile-time, and you cannot add to them at runtime. > > You need to represent your words as strings, and maintain a mapping > table between English and French that way. It would be easy in C++ > or Perl, which come with built in map containers. In Ada, you'll > have to roll your own. > I prefer Python for this. Not surprisingly, in Python they call these kind of containers "Dictionaries". If you are using GNAT, maybe you can try its hash table... Rodrigo