PHP 클래스 SimilarText\Finder

파일 보기 프로젝트 열기: rap2hpoutre/similar-text-finder 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$haystack Haystack
$needle Needle
$sorted_haystack Hold the sorted comparison stack.

공개 메소드들

메소드 설명
__construct ( string $needle, array $haystack ) : void Finder constructor.
all ( ) : array Return all strings in sorted match order.
first ( ) : mixed Return the highest match.
hasExactMatch ( ) : boolean Return whether there is an exact match.

보호된 메소드들

메소드 설명
levenshteinUtf8 ( string $string1, string $string2 ) : integer Calculate the levenshtein distance between two strings.
sortHaystack ( ) : void Sort Haystack.
utf8ToExtendedAscii ( string $str, array &$map ) : string Ensure a string only uses ascii characters.

메소드 상세

__construct() 공개 메소드

Finder constructor.
public __construct ( string $needle, array $haystack ) : void
$needle string
$haystack array
리턴 void

all() 공개 메소드

Return all strings in sorted match order.
public all ( ) : array
리턴 array

first() 공개 메소드

Return the highest match.
public first ( ) : mixed
리턴 mixed

hasExactMatch() 공개 메소드

Return whether there is an exact match.
public hasExactMatch ( ) : boolean
리턴 boolean

levenshteinUtf8() 보호된 메소드

Calculate the levenshtein distance between two strings.
protected levenshteinUtf8 ( string $string1, string $string2 ) : integer
$string1 string
$string2 string
리턴 integer

sortHaystack() 보호된 메소드

Sort Haystack.
protected sortHaystack ( ) : void
리턴 void

utf8ToExtendedAscii() 보호된 메소드

Ensure a string only uses ascii characters.
protected utf8ToExtendedAscii ( string $str, array &$map ) : string
$str string
$map array
리턴 string

프로퍼티 상세

$haystack 보호되어 있는 프로퍼티

Haystack
protected $haystack

$needle 보호되어 있는 프로퍼티

Needle
protected $needle

$sorted_haystack 보호되어 있는 프로퍼티

Hold the sorted comparison stack.
protected $sorted_haystack