|
użytkowników online: 26
|
OPINIE UŻYTKOWNIKÓW
|
Prawdziwa skarbnica wiedzy na temat tworzenia stron WWW i nie tylko. Korzystam z porad praktycznie codziennie, jest mi to niezbędne w mojej pracy. Sam zajmuję się tworzeniem serwisów, ale porady pisane przez Darka sa dla mnie nieocenioną pomocą! Proste, czytelne i zrozumiałe dla każdego! Czekam na więcej!
Krzysztof Szypulski
KESS - projektowanie stron
|
|
PODRĘCZNIK PHP 5.x, 4.x, 3.x - częściowo spolszczony / źródło: www.php.net
[Spis]
[A]
[B]
[C]
[D]
[E]
[F]
[G]
[H]
[I]
[J]
[K]
[L]
[M]
[N]
[O]
[P]
[Q]
[R]
[S]
[T]
[U]
[V]
[X]
[W]
[Z]
metaphone (PHP 4, PHP 5) metaphone -- Calculate the metaphone key of a string Descriptionstring metaphone ( string str [, int phones] )
Calculates the metaphone key of str.
Similar to soundex() metaphone creates the
same key for similar sounding words. It's more accurate than
soundex() as it knows the basic rules of
English pronunciation. The metaphone generated keys are of
variable length.
Metaphone was developed by Lawrence Philips
<lphilips at verity dot com>. It is described in ["Practical
Algorithms for Programmers", Binstock & Rex, Addison Wesley,
1995].
User Contributed Notesaltano at bigfoot dot com
24-Nov-2005 10:48
You can find the source code of a working example on how to use metaphones for spell checking, plus a free MySQL database dump of American English words and their metaphones at http://dubi.org/spell-checker
That should get you started on writing a spell-checker or whatever in no time.
13-Oct-2005 07:44
I have a forum for spanish speakers and the speller that I was using was using the metaphone function and it didn't make a lot of sense. I looked for an equivalent metaphone function for spanish and I never even came close to find it, so I was very happy to find the functional DoubleMetaphone(). Thanks to that function, I came up with this spanish_metaphone function.
Here it is:
http://www.geocities.com/isloera/spanish_methaphone.txt
stpierre(ta)nebr]NOSPAM[wesleyan(tod)edu
09-Jul-2004 08:17
A C implementation of double metaphone is at http://www.cpan.org/modules/ by-authors/id/MAURICE/Text-DoubleMetaphone-0.07.tar.gz. (Sorry I had to break that URL up; wouldn't let me post it otherwise.) If you really need double metaphone that badly, you could roll this into your PHP build for (I would suspect) substantial performance gains.
mail at spam-off dot iaindooley dot com
16-Jan-2004 09:37
you can use the metaphone function quite effectively with phrases by taking the levenshtein distances between two metaphone codes, and then taking this as a percentage of the length of the original metaphone code. thus you can define a percentage error, (say 20%) and accept only matches that are closer than that. i've found this works quite effectively in a function i am using on my website where an album name that the user entered is verified against existing album names that may be similar. this is also an excellent way of people being able to vaguely remember a phrase and get several suggestions out of the database. so you could type "i stiched nine times" with an error percentage of, say, 50 and still get 'a stitch in time saves nine' back as a match.
server: zinkconsulting.com user: galen@
26-Nov-2003 11:18
A small warning about the double metaphone function/class implemented in php: it's slow. Very slow.
On my Mac OS X box it takes roughly 4 seconds to calculate the double_metaphone of a given string 1,000 times and set a variable to that value. Given the exact same code, the built in metaphone function takes a mere 0.03 seconds. That's a huge difference. For reference, soundex takes about 0.015 seconds.
I had dreams of ranking my person database search results with double_metaphone, but with searches yielding a few thousand results sometimes, this isn't terribly reasonable. I'm back to basic metaphone functions.
I'd suggest anyone considering the use of the double_metaphone functionality weigh the slight improvement in results with the fact it's 100 times slower than the php function metaphone. I believe this difference is probably due mostly to implementation and optimization (php code vs. optimized internal php function).
Anybody up for writing a double_metaphone function for php? Maybe php 5?
10-Jan-2003 07:47
Note that you can't really use this on phrases, the results are not what you might expect, see the following test code.
echo metaphone("This is a test");
Output:
0SSTST
echo metaphone("This");
echo metaphone("is");
echo metaphone("a");
echo metaphone("test");
Output:
0SISATST
amon at nonmouse dot net
01-Aug-2002 12:14
You can see this function at work at http://wamex.org.
My only wish is that it returned phonetic values for numbers, instead of "".
ahjs at ozemail dot com dot au
13-Mar-2002 07:51
davef at getacard dot com
22-Apr-2000 03:52
|