Re: [Tutor] language aid (various)

2010-02-07 Thread Owain Clarke
Thanks to all. I will now try to absorb suggestions and follow up links - and no doubt get back to you with my next problem! Owain ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/li

Re: [Tutor] language aid (various)

2010-02-06 Thread Emmanuel Ruellan
On Fri, Feb 5, 2010 at 12:29 PM, Owain Clarke wrote: > > > Seems to be a bit of a consensus here about dictionaries. Let me just > restate my reluctance, using examples from Spanish. > > esperar = to hope > esperar = to wait > tambien = too [i.e. also] > demasiado = too [i.e. excessive] > > So

Re: [Tutor] language aid (various)

2010-02-06 Thread spir
On Fri, 05 Feb 2010 11:29:30 + Owain Clarke wrote: > On Thu, Feb 4, 2010 at 5:43 AM, Owain Clarke wrote: > > > >> My question is, that if I proceed like this I will end up with a single > >> list > >> of potentially several hundred strings of the form "frword:engword". In > >> terms of p

Re: [Tutor] language aid (various)

2010-02-06 Thread Eike Welk
On Friday February 5 2010 12:29:30 Owain Clarke wrote: > What a helpful forum - much thanks to all who've commented. Seems to be > a bit of a consensus here about dictionaries. Let me just restate my > reluctance, using examples from Spanish. > > esperar = to hope > esperar = to wait You could

Re: [Tutor] language aid (various)

2010-02-06 Thread Owain Clarke
On Thu, Feb 4, 2010 at 5:43 AM, Owain Clarke wrote: My question is, that if I proceed like this I will end up with a single list of potentially several hundred strings of the form "frword:engword". In terms of performance, is this a reasonable way to do it, or will the program increasingly sl

Re: [Tutor] language aid

2010-02-04 Thread Alan Plum
On Do, 2010-02-04 at 16:11 +, Owain Clarke wrote: > Thanks for your input. I had discounted the idea of a dictionary > because all the keys need to be unique, so whether the key is the > English or non-English word, it couldn't cope with for example "too", > or a similar word in the other lang

Re: [Tutor] language aid

2010-02-04 Thread Carnell, James E
> Hi, > ? > A dictionary (associative array of keys and values) seems a good > datatype to use. vocab = {} vocab[frenchword]?= englishword > ? ... > Cheers!! > Albert-Jan Sure, a dict is the obvious choice. For saving into file, if the app is to be used internally, you can even print it in

Re: [Tutor] language aid

2010-02-04 Thread Kent Johnson
On Thu, Feb 4, 2010 at 5:43 AM, Owain Clarke wrote: > My question is, that if I proceed like this I will end up with a single list > of potentially several hundred strings of the form "frword:engword". In > terms of performance, is this a reasonable way to do it, or will the program > increasingl

Re: [Tutor] language aid

2010-02-04 Thread spir
On Thu, 04 Feb 2010 16:11:33 + Owain Clarke wrote: > But if one word has different meanings in the other language, you may need to > use a list of words as the values. ? You can have a more sophisticated structure for you dict. For instance, "love" is both a noun and a verb, and each has

Re: [Tutor] language aid

2010-02-04 Thread Alan Gauld
"Owain Clarke" wrote I had discounted the idea of a dictionary because all the keys need to be unique, Thats true but the values can be lists and do not need to be unique. Its probably a better starting point that search through a list looking at every item. so whether the key is the Engl

Re: [Tutor] language aid

2010-02-04 Thread spir
On Thu, 04 Feb 2010 16:11:33 + Owain Clarke wrote: > But if one word has different meanings in the other language, you may need to > use a list of words as the values. ? You can have a more sophisticated structure for you dict. For instance, "love" is both a noun and a verb, and each has

Re: [Tutor] language aid

2010-02-04 Thread spir
On Thu, 4 Feb 2010 07:39:29 -0800 (PST) Albert-Jan Roskam wrote: > Hi, >   > A dictionary (associative array of keys and values) seems a good datatype to > use. > vocab = {} > vocab[frenchword] = englishword >   > For instance: > >>> vocab = {"aimer": "love"} > >>> vocab > {'aimer': 'love'} > >>

Re: [Tutor] language aid

2010-02-04 Thread Owain Clarke
In the face of ambiguity, refuse the temptation to guess. ~~~~~~ --- On Thu, 2/4/10, Owain Clarke wrote: From: Owain Clarke Subject: [Tutor] language aid To: tutor@python.org Date: Thursday, February 4, 201

Re: [Tutor] language aid

2010-02-04 Thread Albert-Jan Roskam
ove parler - speak   But if one word has different meanings in the other language, you may need to use a list of words as the values. Cheers!! Albert-Jan ~~ In the face of ambiguity, refuse the temptation to guess. ~~~~~~ --- On Th

[Tutor] language aid

2010-02-04 Thread Owain Clarke
Hello, all. I am a newcomer to Python, and I know that I have much learning to do before I implement my idea, but I am working on the beginnings of a vocabulary building program. This is how I am catching new words at the moment. def newVocab(x,y): """ Add new word pair, English word second.