comp.lang.ada
 help / color / mirror / Atom feed
* Hi, I'm new to ADA
@ 2003-02-07 16:31 Paul Gregory
  2003-02-07 17:31 ` James S. Rogers
  2003-02-07 18:11 ` Preben Randhol
  0 siblings, 2 replies; 13+ messages in thread
From: Paul Gregory @ 2003-02-07 16:31 UTC (permalink / raw)


I'm a complete novice as all you guys once were in terms of ADA and I've

been given a small school project to do. I'm sure as a novice you
experienced many frustrations and difficulties along the way !

As you people are probably the best people to ask I was wondering if any
of you could give me any tips as to how
to go about the following:

---------------------------------------------------------
---------------------------------------------------------
The task

You are invited to design and implement a translation program which will

take an English sentence and translate it into French (and optionally
translate from French
to English).

Your program will use a simple dictionary containing the following
words:

                                                       English
                                                              French
                                                       big
                                                              grand
                                                       black
                                                              noir
                                                       cat
                                                              chat
                                                       dog
                                                              chien
                                                       is
                                                              est
                                                       small
                                                              petit
                                                       the
                                                              le
                                                       white
                                                              blanc


Example 1

Do you wish to add words to the dictionary?: N

Please enter a sentence:
The cat is white.

The French translation of your sentence is:
Le chat est blanc.

Example 2

Do you wish to add words to the dictionary?: N

Please enter a sentence:
The cat is dead.

I cannot translate that sentence.

Example 3

Do you wish to add words to the dictionary?: Y
English word: horse
Equivalent French word: cheval

Do you wish to add more words?: N

Please enter a sentence:
Le cheval est grand.

The English translation of your sentence is:
The horse is big.

----------------------------------------------------------------------------

----------------------------------------
I know you all have far more important things to be getting on with but
any
advice would be brilliant !

Many thanks,

Paul.







^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Hi, I'm new to ADA
  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  6:37   ` Hi, I'm new to ADA Robert I. Eachus
  2003-02-07 18:11 ` Preben Randhol
  1 sibling, 2 replies; 13+ messages in thread
From: James S. Rogers @ 2003-02-07 17:31 UTC (permalink / raw)


"Paul Gregory" <pg16@bton.ac.uk> wrote in message
news:3E43DF55.DC92A8E8@bton.ac.uk...
> I'm a complete novice as all you guys once were in terms of ADA and I've
>
> been given a small school project to do. I'm sure as a novice you
> experienced many frustrations and difficulties along the way !
>
> As you people are probably the best people to ask I was wondering if any
> of you could give me any tips as to how
> to go about the following:
>
> ---------------------------------------------------------
> ---------------------------------------------------------
> The task
>
> You are invited to design and implement a translation program which will
>
> take an English sentence and translate it into French (and optionally
> translate from French
> to English).
>
> Your program will use a simple dictionary containing the following
> words:
>
>                                                        English
>                                                               French
>                                                        big
>                                                               grand
>                                                        black
>                                                               noir
>                                                        cat
>                                                               chat
>                                                        dog
>                                                               chien
>                                                        is
>                                                               est
>                                                        small
>                                                               petit
>                                                        the
>                                                               le
>                                                        white
>                                                               blanc
>
>
> Example 1
>
> Do you wish to add words to the dictionary?: N
>
> Please enter a sentence:
> The cat is white.
>
> The French translation of your sentence is:
> Le chat est blanc.
>
> Example 2
>
> Do you wish to add words to the dictionary?: N
>
> Please enter a sentence:
> The cat is dead.
>
> I cannot translate that sentence.
>
> Example 3
>
> Do you wish to add words to the dictionary?: Y
> English word: horse
> Equivalent French word: cheval
>
> Do you wish to add more words?: N
>
> Please enter a sentence:
> Le cheval est grand.
>
> The English translation of your sentence is:
> The horse is big.
>
> --------------------------------------------------------------------------
--
>
> ----------------------------------------
> I know you all have far more important things to be getting on with but
> any
> advice would be brilliant !

It appears from your description that you are translating the
words, not the entire language syntax. This can be important to
because it helps define the complexity of your assignment.
A translation of words only will involve a simple look-up and
substitution of words. A translation of syntax will account for
different word order, or contextual evaluation of phrases which
lead to different idiomatic expressions.

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.

Jim Rogers





^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Hi, I'm new to ADA
  2003-02-07 17:31 ` James S. Rogers
@ 2003-02-07 17:40   ` Vinzent Hoefler
  2003-02-09  0:59     ` AG
  2003-02-09  6:37   ` Hi, I'm new to ADA Robert I. Eachus
  1 sibling, 1 reply; 13+ messages in thread
From: Vinzent Hoefler @ 2003-02-07 17:40 UTC (permalink / raw)


"James S. Rogers" <jimmaureenrogers@worldnet.att.net> wrote:

>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.

This issue can easily be solved by trying the translation in both
directions and outputting the one that has (more) success.


Vinzent.



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Hi, I'm new to ADA
  2003-02-07 16:31 Hi, I'm new to ADA Paul Gregory
  2003-02-07 17:31 ` James S. Rogers
@ 2003-02-07 18:11 ` Preben Randhol
  2003-02-07 18:37   ` Vinzent Hoefler
  2003-02-09  1:06   ` AG
  1 sibling, 2 replies; 13+ messages in thread
From: Preben Randhol @ 2003-02-07 18:11 UTC (permalink / raw)


Paul Gregory wrote:
> I'm a complete novice as all you guys once were in terms of ADA and I've
> 
> been given a small school project to do. I'm sure as a novice you
> experienced many frustrations and difficulties along the way !

Please do your homework yourself!


-- 
Preben Randhol ---------------- http://www.pvv.org/~randhol/ --
"Violence is the last refuge of the incompetent", Isaac Asimov



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Hi, I'm new to ADA
  2003-02-07 18:11 ` Preben Randhol
@ 2003-02-07 18:37   ` Vinzent Hoefler
  2003-02-08 10:25     ` Preben Randhol
  2003-02-09  1:06   ` AG
  1 sibling, 1 reply; 13+ messages in thread
From: Vinzent Hoefler @ 2003-02-07 18:37 UTC (permalink / raw)


Preben Randhol <randhol+news@pvv.org> wrote:

>Paul Gregory wrote:
>> I'm a complete novice as all you guys once were in terms of ADA and I've
>> 
>> been given a small school project to do. I'm sure as a novice you
>> experienced many frustrations and difficulties along the way !
>
>Please do your homework yourself!

Hey, don't you just overreact a little bit?

He asked for _advice_, not for somebody doing the work for him.


Vinzent.



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Hi, I'm new to ADA
  2003-02-09  0:59     ` AG
@ 2003-02-08  4:52       ` sk
  2003-02-09  5:35         ` AG
  0 siblings, 1 reply; 13+ messages in thread
From: sk @ 2003-02-08  4:52 UTC (permalink / raw)
  To: comp.lang.ada mail to news gateway

Hi,

ang@xtra.co.nz
 > "Avec son chapeau a la con"

 From Google, "With his hat the idiot has"

"The idiot wears a hat" ?
"His hat is idiotic" ?

Dying to know, please enlightten :-)

-- 
--
-- Merge vertically for real address
--
------------------------------------
-- s n p @ t . o
--  k i e k c c m
------------------------------------




^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Hi, I'm new to ADA
  2003-02-07 18:37   ` Vinzent Hoefler
@ 2003-02-08 10:25     ` Preben Randhol
  0 siblings, 0 replies; 13+ messages in thread
From: Preben Randhol @ 2003-02-08 10:25 UTC (permalink / raw)


Vinzent Hoefler wrote:
> Preben Randhol <randhol+news@pvv.org> wrote:
> 
>>Paul Gregory wrote:
>>> I'm a complete novice as all you guys once were in terms of ADA and I've
>>> 
>>> been given a small school project to do. I'm sure as a novice you
>>> experienced many frustrations and difficulties along the way !
>>
>>Please do your homework yourself!
> 
> Hey, don't you just overreact a little bit?

Hmm, yes. But if you want help for school projects it is better to show
some code that one have done oneself.

-- 
Preben Randhol ---------------- http://www.pvv.org/~randhol/ --
"Violence is the last refuge of the incompetent", Isaac Asimov



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Hi, I'm new to ADA
  2003-02-09  1:06   ` AG
@ 2003-02-08 15:42     ` James S. Rogers
  0 siblings, 0 replies; 13+ messages in thread
From: James S. Rogers @ 2003-02-08 15:42 UTC (permalink / raw)


"AG" <ang@xtra.co.nz> wrote in message
news:Ml%0a.75683$F63.1556321@news.xtra.co.nz...
>
> "Preben Randhol" <randhol+news@pvv.org> wrote in message
> news:slrnb47tkv.22c.randhol+news@kiuk0152.chembio.ntnu.no...
> > Paul Gregory wrote:
> > > I'm a complete novice as all you guys once were in terms of ADA and
I've
> > >
> > > been given a small school project to do. I'm sure as a novice you
> > > experienced many frustrations and difficulties along the way !
> >
> > Please do your homework yourself!
>
> Hold on a second. The guy's not asking for homework, just some
> advice. This seems quite reasonable to me ...

This is why I offered general, language independent advice.
The advice I gave will not automatically result in a program the op
can submit for a grade. It will only (hopefully) help the op focus
his design thoughts on the problem. This is the kind of help I would
offer if I was the op's instructor.

Jim Rogers





^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Avec son chapeau à la con (Was: Hi, I'm new to ADA)
  2003-02-09  5:35         ` AG
@ 2003-02-08 22:12           ` Ludovic Brenta
  0 siblings, 0 replies; 13+ messages in thread
From: Ludovic Brenta @ 2003-02-08 22:12 UTC (permalink / raw)


On Sun, 09 Feb 2003 06:35:13 +0100, AG wrote:
> "sk" <sk@noname.com> wrote in message
> news:mailman.8.1044679703.8221.comp.lang.ada@ada.eu.org...
>> Hi,
>>
>> ang@xtra.co.nz
>>  > "Avec son chapeau a la con"
>>
>>  From Google, "With his hat the idiot has"
>>
>> "The idiot wears a hat" ?
>> "His hat is idiotic" ?
> 
> As I said - I have yet to see a good
> translation. Google notwithstanding.
> I certainly don't know of one :)
> 
> 
>> Dying to know, please enlightten :-)
> 
> Pass if what you need is translation. If you're looking for the source -
> do a search for Zazie + metro ... should be enough ...

"With his f**king hat" would do, I guess.

"a` la con" is a colloquial expression that qualifies
anything particularly ridiculous - in this case, Napoleon's hat.

(I am French).

--
Ludo.



^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Hi, I'm new to ADA
  2003-02-07 17:40   ` Vinzent Hoefler
@ 2003-02-09  0:59     ` AG
  2003-02-08  4:52       ` sk
  0 siblings, 1 reply; 13+ messages in thread
From: AG @ 2003-02-09  0:59 UTC (permalink / raw)



"James S. Rogers" <jimmaureenrogers@worldnet.att.net> wrote:

>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.

Hmmm, I have yet to see a good English translation for:

"Avec son chapeau a la con"






^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Hi, I'm new to ADA
  2003-02-07 18:11 ` Preben Randhol
  2003-02-07 18:37   ` Vinzent Hoefler
@ 2003-02-09  1:06   ` AG
  2003-02-08 15:42     ` James S. Rogers
  1 sibling, 1 reply; 13+ messages in thread
From: AG @ 2003-02-09  1:06 UTC (permalink / raw)



"Preben Randhol" <randhol+news@pvv.org> wrote in message
news:slrnb47tkv.22c.randhol+news@kiuk0152.chembio.ntnu.no...
> Paul Gregory wrote:
> > I'm a complete novice as all you guys once were in terms of ADA and I've
> >
> > been given a small school project to do. I'm sure as a novice you
> > experienced many frustrations and difficulties along the way !
>
> Please do your homework yourself!

Hold on a second. The guy's not asking for homework, just some
advice. This seems quite reasonable to me ...





^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Hi, I'm new to ADA
  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
  0 siblings, 1 reply; 13+ messages in thread
From: AG @ 2003-02-09  5:35 UTC (permalink / raw)



"sk" <sk@noname.com> wrote in message
news:mailman.8.1044679703.8221.comp.lang.ada@ada.eu.org...
> Hi,
>
> ang@xtra.co.nz
>  > "Avec son chapeau a la con"
>
>  From Google, "With his hat the idiot has"
>
> "The idiot wears a hat" ?
> "His hat is idiotic" ?

As I said - I have yet to see a good
translation. Google notwithstanding.
I certainly don't know of one :)

>
> Dying to know, please enlightten :-)

Pass if what you need is translation.
If you're looking for the source - do
a search for Zazie + metro ... should
be enough ...





^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: Hi, I'm new to ADA
  2003-02-07 17:31 ` James S. Rogers
  2003-02-07 17:40   ` Vinzent Hoefler
@ 2003-02-09  6:37   ` Robert I. Eachus
  1 sibling, 0 replies; 13+ messages in thread
From: Robert I. Eachus @ 2003-02-09  6:37 UTC (permalink / raw)


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... ;-)




^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2003-02-09  6:37 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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   ` Hi, I'm new to ADA Robert I. Eachus
2003-02-07 18:11 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox