Computes a normalized similarity score in the range [0.0, 1.0] derived from Levenshtein distance: 1.0 - (distance / max(len($a), len($b))). Two empty strings return 1.0.
$a (string): First string.
$b (string): Second string.
$caseSensitive (bool, default true): Whether comparison is case-sensitive.
Returns:float — Similarity score between 0.0 and 1.0.
Checks whether $pattern is a subsequence of $text (every character of $pattern appears in $text in order, not necessarily contiguously). An empty pattern always matches.
$pattern (string): Pattern to match.
$text (string): Target text.
$caseSensitive (bool, default false): Whether comparison is case-sensitive.
Returns:bool — true if $pattern is a subsequence of $text, false otherwise.
Computes a relevance score in [0.0, 1.0] for ranking a candidate against a query. Exact matches score 1.0, prefix matches score >= 0.85, substring matches score >= 0.70, subsequence matches score >= 0.50, and other strings fall back to scaled Levenshtein similarity.
$query (string): Search query.
$candidate (string): Candidate string.
$caseSensitive (bool, default false): Whether comparison is case-sensitive.
Returns:float — Relevance score between 0.0 and 1.0.
Ranks $candidates against $query and returns up to $limit matches with score >= $minScore, sorted descending by score (ties broken by shorter length, then original index).
$query (string): Search query.
$candidates (array): List of candidate strings.
$limit (int, default 10): Maximum number of results to return (>= 0).