I want to develop a mechanism for search, but I have some requirements for it.
I am not getting where should I start.For example
I have to search this stringstringToSearch = 'I have to search something';
For that I am going to add some labels to certain keywords at start.
suppose Messi will come under football, and Rain will come under Weather and Search will come in Search Engine, Google,...Like that so I have Labels for keywords in short and it could be possible that one keyword is in multiple labels.
Now when I am searching some string I do have to calculate best labels for it and I want to do it on the basis of criteria mentioned below.
I will add keywords to labels on the basis of user answering a search string belongs to which label (User u can take here as a answering agents who will chose their labels so that question of particular labels come to them)
Every time 开发者_如何学Pythonkeywords match will be counted.
If more than one keywords in a string belongs to one labels then select that labels as relevant one.
I have just an idea.
I am good with PHP,Jquery. Some one suggested me to not code it in PHP.
Please suggest me the technologyThank you
a) You split the string at spaces into an array (explode, preg_split, ...)
b) You use array_walk or array_map to have a callback check if the entry corresponds to a label and then replace the value with the label or add the label as an entry to the returned array. If a word doesnt have label you delete it or leave it out.
c) Then you have array_count_values count the labels
精彩评论