Transliteration of search text
with the help of drupal transliteration module (https://www.drupal.org/project/transliteration) please set: $config ['cops_normalized_search'] = "1"; Issue 49 (https://github.com/seblucas/cops/issues/49) fixed Goal : search for Honore should return books written by Honoré de Balzac achieved
This commit is contained in:
parent
eb006c064d
commit
d0f0507c99
182 changed files with 3902 additions and 5 deletions
17
base.php
17
base.php
|
@ -331,10 +331,11 @@ function addURLParameter($urlParams, $paramName, $paramValue) {
|
|||
|
||||
function useNormAndUp () {
|
||||
global $config;
|
||||
return extension_loaded('mbstring') &&
|
||||
extension_loaded('intl') &&
|
||||
class_exists("Normalizer", $autoload = false) &&
|
||||
$config ['cops_normalized_search'] == "1";
|
||||
return $config ['cops_normalized_search'] == "1";
|
||||
// return extension_loaded('mbstring') &&
|
||||
// extension_loaded('intl') &&
|
||||
// class_exists("Normalizer", $autoload = false) &&
|
||||
// $config ['cops_normalized_search'] == "1";
|
||||
}
|
||||
|
||||
function normalizeUtf8String( $s)
|
||||
|
@ -402,8 +403,14 @@ function normalizeUtf8String( $s)
|
|||
return $s;
|
||||
}
|
||||
|
||||
function transliterate ($a) {
|
||||
include_once 'transliteration.php';
|
||||
return _transliteration_process($a);
|
||||
}
|
||||
|
||||
function normAndUp ($a) {
|
||||
return mb_strtoupper (normalizeUtf8String($a), 'UTF-8');
|
||||
//return mb_strtoupper (normalizeUtf8String($a), 'UTF-8');
|
||||
return mb_strtoupper (transliterate($a), 'UTF-8');
|
||||
}
|
||||
|
||||
class Link
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue