From d87cf076349d354b829bfe896ef11247b1182dd9 Mon Sep 17 00:00:00 2001 From: Jacek Kowalski <Jacek@jacekk.info> Date: Sat, 04 May 2019 12:46:08 +0000 Subject: [PATCH] Use number of matched query chars when ordering stop search results --- stops/common.php | 10 +++++++++- 1 files changed, 9 insertions(+), 1 deletions(-) diff --git a/stops/common.php b/stops/common.php index 0d6c3cf..8cf4642 100644 --- a/stops/common.php +++ b/stops/common.php @@ -13,5 +13,13 @@ } unset($word); - return $words; + return array_values($words); +} + +function normalize_name($string) { + return strtr(strtr($string, ['.' => '. ']), [' ' => ' ']); +} + +function normalize_name_cmp($string) { + return normalize_name(mb_strtolower($string, 'UTF-8')); } -- Gitblit v1.9.1