Some pythonic advice needed

Rudy Schockaert rudy.schockaert at pandora.be
Sun Jun 1 16:56:15 CEST 2003


Andrei wrote:
> Have you considered putting more than one answer in the dictionary entry
> of the latin word? You could use a list of translations for it rather
> than a single answer string, something like this:
> 
> mydict = {"latinword": ["dutch1", "dutch2"]}
> 
> combined with:
> 
> if answer in mydict["latinword"]: ....
> 
> I don't know if you need reverse translation too, that would be a bit
> harder but you could build a reverse dictionary from the latin-dutch
> one without any database which seems overkill unless you have huge
> amounts of words.

It is the reverse translation that makes it difficult for me. The list 
below hopefully makes my problem a bit clearer. Words should be 
presented in Dutch as well as in Latin. Not all words are entered at the 
same time too. It is as she learns new words that I add them.
New words that are already in the db with another meaning would have a 
much higher score because she already practised them. The newly added 
words would be asked first, just until their score gets as high as the 
others. From that point on she would be presented older words too.

Latin	Dutch
iste	dat
iste	die
ille	dat
ille	die
qui	dat
qui	die
is	dat
is	die
vere	waar
ubi	waar
ubi	wanneer

Sorry if I can't explain my problem very clear.

I guess I'm looking for a class with the following functions:

- getQuestion(Language) which would return a tuple (questionID, 
question, answer, [alternatives]). Alternatives would be a list of 
(answer, ID) pairs. This would allow me to update the score of an 
alternative too if she would enter that instead of the expected answer.

- updateQuestion(questionID, Score)
This would update the score of an word-pair, pushing it further back in 
the list of questions.





More information about the Python-list mailing list