Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Developing an string in mysql....need help.
Old 06-01-2010, 06:37 AM Developing an string in mysql....need help.
Isabella_Smith's Avatar
Ultra Talker

Posts: 285
Trades: 0
Hi Forum,

I want to develop an string which will show the correct keyword to the visitor when he entered a wrong spelling....like Google..

Did you mean: chocos


Is there anyone can help me on this to create an string for this.

Your help would be appreciated.

Thanks
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE
buy all indian salwar Kameez, Sarees and clothes
Isabella_Smith is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 06-01-2010, 06:49 AM Re: Developing an string in mysql....need help.
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
This is NOT a database question so assuming PHP the thread is being moved AND it needs more than "a string"
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-01-2010, 07:29 AM Re: Developing an string in mysql....need help.
Isabella_Smith's Avatar
Ultra Talker

Posts: 285
Trades: 0
Quote:
Originally Posted by chrishirst View Post
This is NOT a database question so assuming PHP the thread is being moved AND it needs more than "a string"
Such as ????


I don't know that's why I am asking here....your help would be appreciated.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE
buy all indian salwar Kameez, Sarees and clothes
Isabella_Smith is offline
Reply With Quote
View Public Profile
 
Old 06-01-2010, 08:03 AM Re: Developing an string in mysql....need help.
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
First of all you need a data structure of every word in the language(s) your site is using.
You can of course limit this to every word on your site (maybe 3 letters and over) to reduce storage space.
Also to save even more space you could 'tokenise' combinations of letters (this is how spell checkers compress the data on your wordprocessor spellcheck/dictionary)

Then you need a lookup structure of mis-spellings and synonyms etc, this can of course be "self-learning" insofar as the user selecting a replacement also adds to the structure.

Your system first searches the primary word structure and if no matches are found, searches the lookup structure and offers the choice(s) to the users.

This is obviously a simplistic overview and the reality is somewhat more complex.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-01-2010, 08:31 AM Re: Developing an string in mysql....need help.
Isabella_Smith's Avatar
Ultra Talker

Posts: 285
Trades: 0
What do you think about this: http://us3.php.net/manual/en/function.levenshtein.php
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE
buy all indian salwar Kameez, Sarees and clothes
Isabella_Smith is offline
Reply With Quote
View Public Profile
 
Old 06-01-2010, 08:41 AM Re: Developing an string in mysql....need help.
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
Yep you can use Levenshtein distance to calculate the a likely replacement.
However you STILL need to find a list of alternatives words to run the comparison against
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-01-2010, 08:43 AM Re: Developing an string in mysql....need help.
Isabella_Smith's Avatar
Ultra Talker

Posts: 285
Trades: 0
I'll use the words in my database....to match with the correct.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE
buy all indian salwar Kameez, Sarees and clothes

Last edited by Isabella_Smith; 06-01-2010 at 08:45 AM..
Isabella_Smith is offline
Reply With Quote
View Public Profile
 
Old 06-01-2010, 09:10 AM Re: Developing an string in mysql....need help.
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,385
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
And of course you could experiment with SOUNDEX() and SOUNDS LIKE.

English language ONLY though.
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 06-01-2010, 10:12 AM Re: Developing an string in mysql....need help.
Isabella_Smith's Avatar
Ultra Talker

Posts: 285
Trades: 0
Thanks Chrishirst,

You could suggest me these before as well, but did not try hard.

Thanks though..

Here's the useful like for those who are searching same thing:

http://css.dzone.com/news/google-sty...id=0&refresh=0

Thanks!!
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE
buy all indian salwar Kameez, Sarees and clothes
Isabella_Smith is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Developing an string in mysql....need help.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.29548 seconds with 12 queries