I want to create a dictionary, a very simple one, just two languages.
Can anyone help me on that? How do i design the database? I just want to get the point.
Thank You
Tips on how to create a dictionary
Moderator: General Moderators
-
klevis miho
- Forum Contributor
- Posts: 413
- Joined: Wed Oct 29, 2008 2:59 pm
- Location: Albania
- Contact:
Re: Tips on how to create a dictionary
Well..make a table with a load of words in I guess.
Although I'd personally use the pspell dictionary/extension. It's pretty cool.
Although I'd personally use the pspell dictionary/extension. It's pretty cool.
-
klevis miho
- Forum Contributor
- Posts: 413
- Joined: Wed Oct 29, 2008 2:59 pm
- Location: Albania
- Contact:
Re: Tips on how to create a dictionary
You mean a table with such columns: id, word, translation ? lol
You're right, but i thought on having multiple tables; for example one english one spanish
You're right, but i thought on having multiple tables; for example one english one spanish
-
klevis miho
- Forum Contributor
- Posts: 413
- Joined: Wed Oct 29, 2008 2:59 pm
- Location: Albania
- Contact:
Re: Tips on how to create a dictionary
PS. I wan't to make it myself, for learning purposes 
Re: Tips on how to create a dictionary
Oh right.
Well...I guess
ID (auto increment, primary key)
Word (varchar...something long?)
Translation (ditto)
Word_Definition (text)
Translation_Definition (text)
Although I have no idea how you're going to populate these tables with words...you could do it yourself...but that'd take forever.
Well...I guess
ID (auto increment, primary key)
Word (varchar...something long?)
Translation (ditto)
Word_Definition (text)
Translation_Definition (text)
Although I have no idea how you're going to populate these tables with words...you could do it yourself...but that'd take forever.
-
klevis miho
- Forum Contributor
- Posts: 413
- Joined: Wed Oct 29, 2008 2:59 pm
- Location: Albania
- Contact:
Re: Tips on how to create a dictionary
I don't want to use just one table, the idea is that a word has one ore more translations.
As for populating the tables i don't think it would take forever because it should be a dictionary just for IT words
As for populating the tables i don't think it would take forever because it should be a dictionary just for IT words
Re: Tips on how to create a dictionary
Oh right. Well in that case you'll need a reference ID or something.
Table 1:
ID (auto increment, primary key)
Ref_ID (int)
Word (varchar...something long?)
Table2:
ID (auto increment, primary key)
Ref_ID (int) (this will be the same as table 1's Ref_ID)
translation (varchar)
That way, when someone goes to your dictionary page, say "dictionary.php?refid=777", you can select from table 1 where refid is 777, and join Table2 where Table1.Ref_Id = Table2.Ref_Id.
Table 1:
ID (auto increment, primary key)
Ref_ID (int)
Word (varchar...something long?)
Table2:
ID (auto increment, primary key)
Ref_ID (int) (this will be the same as table 1's Ref_ID)
translation (varchar)
That way, when someone goes to your dictionary page, say "dictionary.php?refid=777", you can select from table 1 where refid is 777, and join Table2 where Table1.Ref_Id = Table2.Ref_Id.
- jayshields
- DevNet Resident
- Posts: 1912
- Joined: Mon Aug 22, 2005 12:11 pm
- Location: Leeds/Manchester, England
Re: Tips on how to create a dictionary
You'll want to use a one-to-many relationship then.
So have a table with an ID and a word to translate, then have a table for translations, which could have the word ID, language, and translation.
So have a table with an ID and a word to translate, then have a table for translations, which could have the word ID, language, and translation.