Mark
|
| Posted: 04/20/2002, 12:36 PM |
|
Hi,
not necessarily a CodeCharge query (!), but I'm using PHP & MySQL and want
to be a able to do a phonetic search - is this possible ?
Example - a user enters "Tea" and the search returns "Tea" & "Tee".
Any ideas ?
Thanks,
Mark
|
|
|
 |
Alexey Alexapolsky
|
| Posted: 04/22/2002, 2:40 AM |
|
Ideas :
1) Create user defined function that returns how many characters are
different in
2 given words. Then use it in your sql statement (e.g. where
dist(w1,w2)<2).
This is kinda half-phonetic.
2) Obtain a database of basic english words with hashed sounds , where close
words have close values. Use these values in where clause like above.
I've no idea where it can be obtained. It might be even generated with some
phonetic software.
--
Alex
CodeCharge Developer
"Mark" <mark@markate.demon.co.uk> wrote in message
news:a9sg0q$aan$1@news.codecharge.com...
> Hi,
>
> not necessarily a CodeCharge query (!), but I'm using PHP & MySQL and want
> to be a able to do a phonetic search - is this possible ?
>
> Example - a user enters "Tea" and the search returns "Tea" & "Tee".
>
> Any ideas ?
>
> Thanks,
> Mark
>
>
|
|
|
 |
Richi Novello
|
| Posted: 04/25/2002, 12:19 PM |
|
From MySQL manual:
SOUNDEX(str)
Returns a soundex string from str. Two strings that sound almost the same
should have identical soundex strings. A standard soundex string is 4
characters long, but the SOUNDEX() function returns an arbitrarily long
string. You can use SUBSTRING() on the result to get a standard soundex
string. All non-alphanumeric characters are ignored in the given string. All
international alpha characters outside the A-Z range are treated as vowels:
mysql> select SOUNDEX('Hello');
-> 'H400'
mysql> select SOUNDEX('Quadratically');
-> 'Q36324'
Maybe it can be of use...
Good luck
Richi Novello
"Mark" <mark@markate.demon.co.uk> ha scritto nel messaggio
news:a9sg0q$aan$1@news.codecharge.com...
> Hi,
>
> not necessarily a CodeCharge query (!), but I'm using PHP & MySQL and want
> to be a able to do a phonetic search - is this possible ?
>
> Example - a user enters "Tea" and the search returns "Tea" & "Tee".
>
> Any ideas ?
>
> Thanks,
> Mark
>
>
|
|
|
 |
|