From: philip at cornado dot com Operating system: Irrelevant PHP version: Irrelevant PHP Bug Type: Feature/Change Request Bug description: callback function for levenshtein
Description: ------------ The levenshtein() documentation goes into great detail on a third yet to be implemented parameter for a levenshtein callback function. Below are those docs which will soon be removed from the php manual until this feature is actually implemented: The third variant (which is not implemented yet) will be the most general and adaptive, but also the slowest alternative. It will call a user-supplied function that will determine the cost for every possible operation. The user-supplied function will be called with the following arguments: * operation to apply: 'I', 'R' or 'D' * actual character in string 1 * actual character in string 2 * position in string 1 * position in string 2 * remaining characters in string 1 * remaining characters in string 2 The user-supplied function has to return a positive integer describing the cost for this particular operation, but it may decide to use only some of the supplied arguments. The user-supplied function approach offers the possibility to take into account the relevance of and/or difference between certain symbols (characters) or even the context those symbols appear in to determine the cost of insert, replace and delete operations, but at the cost of losing all optimizations done regarding cpu register utilization and cache misses that have been worked into the other two variants. Attempting to use it gives us: php_error_docref(NULL TSRMLS_CC, E_WARNING, "The general Levenshtein support is not there yet"); And a return value of -1. -- Edit bug report at http://bugs.php.net/?id=29552&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=29552&r=trysnapshot4 Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=29552&r=trysnapshot5 Fixed in CVS: http://bugs.php.net/fix.php?id=29552&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=29552&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=29552&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=29552&r=needscript Try newer version: http://bugs.php.net/fix.php?id=29552&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=29552&r=support Expected behavior: http://bugs.php.net/fix.php?id=29552&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=29552&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=29552&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=29552&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=29552&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=29552&r=dst IIS Stability: http://bugs.php.net/fix.php?id=29552&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=29552&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=29552&r=float