Hi all,
I plan to make a PRACTICAL dictionary and need help on just ideas.
basically you can use dict datatype for simple dictionary and use dicy->key to retrieve but does that work for larger data queried from database? Or should I implement a database of key --->value?

Any Idea from you guys?
any Idea is welcomed :)
Thanks alot

This is obviously off topic, but may I ask why you are using Junior M.D.'s picture and signature. They're not bad, but copying someone's signature is prohibited on some sites.

hahaha!
That Junior MD is me.
I hope copying my own stuffs isn't illegal, or at least in Daniweb.
So be at peace hehehe :)

Just making sure.

use dict datatype for simple dictionary and use dicy->key to retrieve

That would be the easiest way, not the most efficient or speedy. I would definitely implement a database of key--> value, though it would take longer. It depends on how serious or big you want it to be. If this is going to be a simple 100 word dictionary then by all means use a simple dictionary. If it's going to be a huge dictionary then I would implement the database and do the whole 9 yards.

If it's going to be a huge dictionary then I would implement the database and do the whole 9 yards.

It is large comparable to Oxford's or Webster's dictionaries
So I will consider your last suggestion over dict method.

Thanks for your ideas

I did it in Java and used two binary search trees, one for english to french (with the keyfield being the english word) and another for french to english. Was pretty speedy.

Hi Benett,
can you explain a little bit?
I have never done Java so I don't understand well what you are saying.
Can you speak Pythonic, or at least C++?

Do you know what a linked list and binary tree is? Pointers?

The dictionary container is highly optimized (for search speed and memory usage) in Python, and is used internally by the interpreter.

You can create an 'english_word: french_word' dictionary and easily swap it to a 'french_word: english_word' dictionary for speedy lookups in either language. However you have to make sure that words are unique in either language so they can form the keys.

. However you have to make sure that words are unique in either language so they can form the keys.

yeah thats not going to work seeing as many english words dont actually exist in french, and many english words all mean the same thing... also some french words are long strings (e.g if you translate potato into french youll get pomme dé terre... if yoi translate that back into english youll get "apple of ground" which makes no sense.....

In a dictionary container the 'potato' : 'pomme dé terre'
key:value pair will work well after the language swap.

If you have several English words for one French word you need to use a tuple container as a value. Tuples can be used for keys on a swap. Then in your key search you have to go through the items in the tuple one by one, if the key type is a tuple.

This project can quickly become rather complex, no matter what approach you pick. If you have a choice of words to pick from, you need the know the language by heart, or at least the meaning of the word in the sentence it is used in!

George Carlin used to make a lot of money explaining the quirks of the English language. I imagine he had a counterpart in France.

commented: pretty decent explaination +21

This project can quickly become rather complex, no matter what approach you pick. If you have a choice of words to pick from, you need the know the language by heart, or at least the meaning of the word in the sentence it is used in!

I agree.
What about English to English dictionary?

I'm using an online dictionary. This is what I get for potato :)

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.