You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
544 B
24 lines
544 B
<?php
|
|
|
|
namespace TomLingham\Searchy\Matchers;
|
|
|
|
/**
|
|
* Matches strings for Acronym 'like' matches but does NOT return Studly Case Matches.
|
|
*
|
|
* for example, a search for 'fb' would match; 'foo bar' or 'Fred Brown' but not 'FreeBeer'.
|
|
*
|
|
* Class AcronymMatcher
|
|
*/
|
|
class LevenshteinMatcher extends BaseMatcher
|
|
{
|
|
/**
|
|
* @param $column
|
|
* @param $searchString
|
|
*
|
|
* @return mixed|string
|
|
*/
|
|
public function buildQueryString($column, $searchString)
|
|
{
|
|
return "levenshtein($column, '$searchString')";
|
|
}
|
|
}
|