PDA

View Full Version : How Do I Build A Dictionary Database?


Rex
04-02-2006, 08:42 PM
I am attempting to learn how to design a dynamic website. I believe I will want to build an English to Spanish dictionary as a database. This dictionary is specialized to medical vocabulary to communicate with families of ill newborns. I have the files in several formats (Word, text, Excel, HTML) but unsure how to proceed from here. What I was hoping to provide was a entry field where the English word could be entered and the Spanish equivalent displayed. In that way one could type in the word crib and the equivalent would display cuna.

The motivation of this is both practical and for a learning experience for myself. The overall site is going up soon, the dictionary has been in use for a number of years in a table (HTML) format. I want to share it on a wider scale. I also wish to learn how to design, and build such a site.

Any suggestions? Direct instruction, books, articles, websites?

solarnexus
04-03-2006, 05:01 PM
use a database (MySQL, XML, whatever) which stores each word, and give each word an index and a language specifier, then give each word language-equivilent field (used to define the index of another word which means the same) like so:

(index) (word) (lang) (lang_equiv)
1 apple eng 2
2 manzana span 1

then use a method which converts it all. In PHP & MySQL this would be like so:

function translate( $word )
{
$word_index = mysql_result( mysql_query( "SELECT * FROM dictionary WHERE 'word' = " . $word) , 'index' );

return mysql_result( mysql_query( "SELECT * FROM dictionary WHERE 'index' = " . $word_index ) , 'word' );
}

*this is only an example and my not work 'out of the box' but I think you'll get the idea.