mostafatalebi Posted November 9, 2012 Share Posted November 9, 2012 Hello everybody I am creating a translation-service website, and I want to know how theoretically I can make an online dictionary. I mean using javascript I make a medical-dictionary or something else. Can anyone give me a general process of how to make a dictionary online using javascript? Quote Link to comment https://forums.phpfreaks.com/topic/270493-making-dictionary-with-javascript/ Share on other sites More sharing options...
mostafatalebi Posted November 9, 2012 Author Share Posted November 9, 2012 For instance Shall I use a mySQL or just a file of words being processed by regular expression? Quote Link to comment https://forums.phpfreaks.com/topic/270493-making-dictionary-with-javascript/#findComment-1391242 Share on other sites More sharing options...
mostafatalebi Posted November 9, 2012 Author Share Posted November 9, 2012 isn't there anybody to reply!!!!! Quote Link to comment https://forums.phpfreaks.com/topic/270493-making-dictionary-with-javascript/#findComment-1391247 Share on other sites More sharing options...
trq Posted November 9, 2012 Share Posted November 9, 2012 Are you talking about client side Javascript or server side Javascript? I shouldn't imagine this would be something you would do client side. Quote Link to comment https://forums.phpfreaks.com/topic/270493-making-dictionary-with-javascript/#findComment-1391250 Share on other sites More sharing options...
mostafatalebi Posted November 9, 2012 Author Share Posted November 9, 2012 no it is probably a script to be installed on my Host, then provide an authentication just like any website, and the user login into my site and searches for his word. It is server-side. The user who is employed as a translator in my website, and then has access to an area called "Get Help from Dictionary", then he enters and searches for his vocab. Quote Link to comment https://forums.phpfreaks.com/topic/270493-making-dictionary-with-javascript/#findComment-1391253 Share on other sites More sharing options...
trq Posted November 9, 2012 Share Posted November 9, 2012 There are plenty of tutorials around in regards to searching a database using libraries such as mongoose for node etc. Where exactly are you stuck? OD you have your database of data? I would start there. Once you have the actual data, only then can you look at how to best access it. It shouldn't be difficult tat all once you have the actual data. Quote Link to comment https://forums.phpfreaks.com/topic/270493-making-dictionary-with-javascript/#findComment-1391254 Share on other sites More sharing options...
mostafatalebi Posted November 9, 2012 Author Share Posted November 9, 2012 let me provide you with an example then see is it a good solution: I have a database which consists of two columns: "Word" "definition" Then the user searches a word called "Pixel", what happen is that my dictionary goes through the table and searches for that specific word: "SELECT definistion FROM dictionary WHERE word='Pixel'" Is it logical? Quote Link to comment https://forums.phpfreaks.com/topic/270493-making-dictionary-with-javascript/#findComment-1391257 Share on other sites More sharing options...
trq Posted November 9, 2012 Share Posted November 9, 2012 Of course it's logical. Does it work? On a simple level yes. Quote Link to comment https://forums.phpfreaks.com/topic/270493-making-dictionary-with-javascript/#findComment-1391258 Share on other sites More sharing options...
mostafatalebi Posted November 9, 2012 Author Share Posted November 9, 2012 What to do on a complex level where there are 200.000 words with definition which at least would account for 1.000.000 words in total! Quote Link to comment https://forums.phpfreaks.com/topic/270493-making-dictionary-with-javascript/#findComment-1391269 Share on other sites More sharing options...
trq Posted November 9, 2012 Share Posted November 9, 2012 The same logic applies to map 1 term to 1 definition. It doesn't matter how many terms there are. Quote Link to comment https://forums.phpfreaks.com/topic/270493-making-dictionary-with-javascript/#findComment-1391271 Share on other sites More sharing options...
codefossa Posted November 9, 2012 Share Posted November 9, 2012 Well, you need to remember that words can have multiple definitions. Also, you probably want to add pronunciation, maybe the type .. like noun verb etc depending on each definition, and maybe even an example of how it's used. This is all stuff you can rip from somewhere. An easier way is probably to find an API you can use because it's much easier than trying to create your own dictionary. On a side note. If you continue and need to add more definitions to a word, I would use one table for the word and an ID, then another for the definition, pronunciation, usage, etc. That way you can link them by the ID of the word and won't have any problems adding more or removing any at any time. Quote Link to comment https://forums.phpfreaks.com/topic/270493-making-dictionary-with-javascript/#findComment-1391272 Share on other sites More sharing options...
mostafatalebi Posted November 9, 2012 Author Share Posted November 9, 2012 Thanks very much. Quote Link to comment https://forums.phpfreaks.com/topic/270493-making-dictionary-with-javascript/#findComment-1391281 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.