Req #29552 [Fbk->NoF]: Callback function for levenshtein

From: Date: Tue, 30 Dec 2014 10:41:27 +0000
Subject: Req #29552 [Fbk->NoF]: Callback function for levenshtein
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-189375@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=29552&edit=1 ID: 29552 Updated by: php-bugs@lists.php.net Reported by: philip at cornado dot com Summary: Callback function for levenshtein -Status: Feedback +Status: No Feedback Type: Feature/Change Request Package: Strings related Operating System: Irrelevant PHP Version: Irrelevant Private report: N New Comment: No feedback was provided. The bug is being suspended because we assume that you are no longer experiencing the problem. If this is not the case and you are able to provide the information that was requested earlier, please do so and change the status of the bug back to "Re-Opened". Thank you. Previous Comments: ------------------------------------------------------------------------ [2014-04-21 20:27:49] levim@php.net Is this something you are still interested in seeing? A quick look at the docs indicates that it hasn't been added. ------------------------------------------------------------------------ [2004-08-06 18:09:50] philip at cornado dot com 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 this bug report at https://bugs.php.net/bug.php?id=29552&edit=1

« previous php.bugs (#189375) next »