Hello, I want to add the 'did you mean' feature (like on Google) on my shareware site, where a lot of users have mistypes, and they get 0 results... so they exit the site very fast. Do you have any idea how I could implement such a thing? Does it require a dictionary or something? I found some scripts, but none of them gave relevant results... just stupid, irrelevant suggestions. Any help would be appreciated... sample code would be awesome.
Thanks, Lucy
7 3897
That's no easy task! Have you considered just putting a Google search form on your site though? I.e. a form that uses Google to search just within your site. It would be a lot easier!
The following functions will be of help to you. Look it up in your php manual
levenshtein()
soundex(),
similar_text(),
and metaphone().
dlite922 1,584
Recognized Expert Top Contributor
The following functions will be of help to you. Look it up in your php manual
levenshtein()
soundex(),
similar_text(),
and metaphone().
I was actually wondering what else is there besides soundex() , thanks for the quick and dirty list! I might use this for a government app.
DM
google custom search is not good for me... i want to display the results in my layout, using some special boxes....
anyway, am now trying levenstein, soundex, and also yahoo api. thanks.
Markus 6,050
Recognized Expert Expert
The following functions will be of help to you. Look it up in your php manual
levenshtein()
soundex(),
similar_text(),
and metaphone().
*heads to php.net*
Thanks aktar!
OK, the winner is Yahoo Spelling Suggestion (which uses Yahoo API). This gives your site the possibility to suggest exactly what Yahoo Search suggests :cool: Awesome, I would say!
Here is a short summary about using it, if you guys want to use it too: it requires a Yahoo API key, which can be got free. It is limited to 5000 queries per day, so I suggest caching the suggestion (which I implemented, as my site has more then 5000 searches per day). The page returned by Yahoo needs to be parsed, and see if there is a suggestion given. This is a page that gives a suggestion, this is one that has no suggestion.
You can see it on my shareware site: link removed by moderator like "enail backup", "rgistry cleaner" or whatever you want. I also implemented a function to make bold italic the words that are different between the search query and the suggestion from Yahoo. ;)
If you need assistance on implementing this on your site, let me know.
Thanks, Lucy
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Roy Yao |
last post by:
Does it mean "(sizeof(int))* (p)" or "sizeof( (int)(*p) )" ?
According to my analysis, operator sizeof, (type) and * have the same
precedence, and they combine from right to left. Then this expression should
equal to "sizeof( (int)(*p) )", but the compiler does NOT think so. Why?
Can anyone help me? Thanks.
Best regards.
Roy
|
by: Luke Wu |
last post by:
I am just wondering what the following terms usually mean:
1) "Standard C"
2) "K&R C"
3) "ANSI C"
I am pretty sure "ANSI C" usually refers to the C89 standard, but what
|
by: Colin Peters |
last post by:
Hi,
I'm a terrible speller. So are many people, and I think it's getting
worse. That's why Googles' function to suggest re-searching with
corrected misspelled words is really nice.
Now I'm implementing an aspx page to handle 404 NotFound cases, and I
thought it'd be cool to look at the page name that the user tried to
access and see if it nearly matches any existing pages. Then I could
show a page like: "This file cannot be found. Did...
|
by: Coldman |
last post by:
which was saying this:
"i have an asp:repeater - its values r initialezed w/ a .DataBind() call
does it mean any changes user makes on the page will automaticly go to the
database?
quite unlikely
how do u actually send the values to the db - any repeater specific article
is more than welcome"
|
by: meenasamy |
last post by:
Hi all i have used a script that i downloaded and uses the
fopen($url,'r'); function to access a url to retrieve data and i get
this error
Fatal error: fopen(): Unable to find the wrapper "https" - did you
forget to enable it when you configured PHP?
i checked the 'allow_url_fopen = On' in php.ini and it is set to On,
and still it didn't work
| |
by: arindam.mukerjee |
last post by:
I was running code like:
#include <stdio.h>
int main()
{
printf("%f\n", 9/5);
return 0;
}
|
by: hn.ft.pris |
last post by:
I know int *p mean an array of pointers to int, but I meet int
(*p) which is confusing.
What does it mean and how to use it? Thanks for help.
|
by: semutmerah |
last post by:
hi..
my english maybe wrong.. but hope somebody can understand me :)
I did created 3 forms. "MainForm" , "CalForm" , "WaitForm".
On "MainForm", I did put a command button called "Run".
On "CalForm", there were some unbound "text box" which have some calculation
|
by: miller.paul.w |
last post by:
This is a wee bit OT, but I am looking for algorithms to implement
search suggestions, similar to Google's "Did you mean... ?" feature.
Can anyone point me to web pages, journal articles, implementations
(preferably in Python!), or any other resources in this area?
Thanks!
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |