I am using a wordNet database for my website and I was looking for the synonym.
The scenario is
The website is an e-commerce website. There is a search box for the user. Once the user key in the keyword to search, the system will directly find a synonym based on the user input and match it with my own database and show results. So, for example, in my database, there is just item with name microwave. But after I get the synonym for the microwave, there is another synonym based on the microwave, such as oven.
So, what I want is, the system will display the result of microwave even though the user type in "oven", because basically these two things are the same.
I was thinking to put into an array for the first synonym result from the wordNet database. But, the problem is how can I display the result based on the synonym?
i was thinking about query like this. This query is to get the data from my own database and use the list of data retrieved from the wordnet database
Select the information needed
from the database table
where category.name LIKE (the array of result from wordnet database)
Am I in right way?
Please note that I have succeed retrieved the synonym from the wordnet database. The problem is how can I use this list of synonyms retrieved from the wordnet database to produce data that is from my database?
Can somebody please guide me?
Any help given is highly appreciated. Thanks
LIKE, useINfollowed by a list of synonymous category names.SELECT fields FROM products_table WHERE category IN ("ovens","microwaves","kitchen equipment"). This of course requires that yourproducts_tablecontains a column calledcategory. If you don't have that in place, yet, you shouldn't create it that way but rather have a dedicated "categories" table with a category_id, category_name and another table connecting category_ids with product_ids so that one product can be part of more than one category.SELECTquery should be along these lines:SELECT * FROM products, categories, product_categories WHERE products.product_id = product_categories.product_id AND product_categories.category_id = categories.category_id AND categories.category_name IN ("category1","category2","category3")-- the category1, 2, 3 being what you retrieved from the wordNet database.