Hướng dẫn dùng levenshtien distance trong PHP
Hướng dẫn cách sử dụng hàm levenshtein() trong lập trình PHP Tác dụng của hàm levenshtein()The The following table summarizes the technical details of this function.
SyntaxThe basic syntax of the levenshtein(string1, string2, cost_insert, cost_replacement, cost_delete); In its simplest form the function will take only the two strings as parameter and will calculate just the number of insert, replace and delete operations needed to transform string1 into string2. The following example shows the Example
Tip: The Note: The Levenshtein distance is defined as the minimum number of characters you have to replace, insert or delete to transform string1 into string2. The complexity of the algorithm is ParametersThe
More ExamplesHere're some more examples showing how The following example demonstrates how to search for the closest match of a misspelled word inside an array of words. You can adjust the sensitivity of the result according to your need. Example
Bài viết này đã giúp ích cho bạn?Bài viết mới |