943,935 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 994
  • PHP RSS
Nov 3rd, 2009
0

MySQL to search for spelling mistakes in rows, columns?

Expand Post »
Hi!

After years I decided to sign up!

Can you please tell me of a bot tutorial or getting a solution to my problem. What direction should I be going.

I want to make a PHP script that searches a MySQL table's columns, rows and then returns all the spelling mistakes in those cells..

Anyone?

Thanks
Similar Threads
slr
Reputation Points: 10
Solved Threads: 0
Newbie Poster
slr is offline Offline
15 posts
since Nov 2009
Nov 4th, 2009
0
Re: MySQL to search for spelling mistakes in rows, columns?
you can search for any ready made spell checked available else where.
You won't be able to do it alone with php unless you have a huge database of the words, against which you can check your spellings.
Reputation Points: 29
Solved Threads: 76
Practically a Master Poster
network18 is offline Offline
616 posts
since Sep 2009
Nov 4th, 2009
0
Re: MySQL to search for spelling mistakes in rows, columns?
Yea, whatever you do, you will need a list of correctly spelled words to test against. PHP has no way to determine what is and is not incorrectly spelled unless it has something to compare it to.

Once you have that list, however, PHP has a few functions you can use to "guess" the correct word. Like the levenshtein function. (See the example there)
Last edited by Atli; Nov 4th, 2009 at 4:19 am. Reason: Clarifying.
Reputation Points: 93
Solved Threads: 70
Posting Pro
Atli is offline Offline
526 posts
since May 2007
Nov 4th, 2009
0
Re: MySQL to search for spelling mistakes in rows, columns?
I have massive database of spelling words, dictionaries and grammar queries..

Is there no match like and replace type thing I can do?

If search.php action is..

$get request [q]

sql = select * all from products where q="request query form q" and match with spellinglist where word is like "request query form q" and like "spellinglist" suggestion
slr
Reputation Points: 10
Solved Threads: 0
Newbie Poster
slr is offline Offline
15 posts
since Nov 2009
Nov 4th, 2009
0
Re: MySQL to search for spelling mistakes in rows, columns?
yes, you got it right. But if the spelling is wrong , say the user is searching for "camel"
and he types "camal: then your code need to do this too.
query should include...."..like '%cam[single char]l' " etc
or "..like '%cam%' " etc.
In short you will need to experiment with the wild cards little bit
Reputation Points: 29
Solved Threads: 76
Practically a Master Poster
network18 is offline Offline
616 posts
since Sep 2009
Nov 4th, 2009
0
Re: MySQL to search for spelling mistakes in rows, columns?
Is there any way to do via an array.

I actually want to scan a html document source code and try to find spelling mistakes in it..
slr
Reputation Points: 10
Solved Threads: 0
Newbie Poster
slr is offline Offline
15 posts
since Nov 2009
Nov 4th, 2009
0
Re: MySQL to search for spelling mistakes in rows, columns?
see if this is useful for you,
and
Reputation Points: 29
Solved Threads: 76
Practically a Master Poster
network18 is offline Offline
616 posts
since Sep 2009
Nov 4th, 2009
0
Re: MySQL to search for spelling mistakes in rows, columns?
Thanks. I tried spellr.us.. that seems to be the best - I want to scan thousands of pages though.. and I want to do it myself free..
slr
Reputation Points: 10
Solved Threads: 0
Newbie Poster
slr is offline Offline
15 posts
since Nov 2009
Nov 4th, 2009
-1
Re: MySQL to search for spelling mistakes in rows, columns?
Like some mentioned, you'll need to decide on your options.
Also you'll need to ensure that punctuation marks are not included
in your words to check. It's possible that some words will have numbers in them (e.g. chemicals), so you may want to include words that have numbers in them, but not numbers by themselves.

If you get a 'nomatch', you'll then need to trawl for a series of wildcarded options and list them alphabetically.

You could use an autosuggest (ajax) list, although a MASSIVE db may slow down this function.
Sponsor
Featured Poster
Reputation Points: 1048
Solved Threads: 948
Sarcastic Poster
ardav is offline Offline
6,698 posts
since Oct 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Static Content + Paging
Next Thread in PHP Forum Timeline: using variable substitutions in conditional statements





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC