473,804 Members | 2,998 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

The "Did you mean" feature

3 New Member
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
Mar 20 '08 #1
7 3897
adamalton
93 New Member
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!
Mar 20 '08 #2
coolgames
169 New Member
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!
yes, http://www.google.com/coop/cse/ that will help you (it does require some work do be done) or, you can use scripts that will be hosted right in your website like these:

http://www.thesitewizard.com/archive/searchengine.shtml
Mar 20 '08 #3
aktar
105 New Member
The following functions will be of help to you. Look it up in your php manual

levenshtein()
soundex(),
similar_text(),
and metaphone().
Mar 20 '08 #4
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
Mar 21 '08 #5
lucy82m
3 New Member
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.
Mar 21 '08 #6
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!
Mar 21 '08 #7
lucy82m
3 New Member
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
Mar 22 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

70
8919
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
4
3756
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
1
1793
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...
3
1268
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"
5
43225
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
17
2521
by: arindam.mukerjee | last post by:
I was running code like: #include <stdio.h> int main() { printf("%f\n", 9/5); return 0; }
12
8427
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.
2
2666
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
1
3026
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!
0
9706
marktang
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...
0
10578
Oralloy
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...
0
10332
jinu1996
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...
1
10321
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,...
0
6853
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();...
0
5651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4300
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
2
3820
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2991
bsmnconsultancy
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...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.