From 889c8676cf5a5dfd04abd393e74e6b4cd254f240 Mon Sep 17 00:00:00 2001 From: Josef Moravec Date: Thu, 21 Jul 2016 07:46:23 +0200 Subject: [PATCH] Bug 16952: Czech language definitions for sorting in Zebra MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Test plan: 1) Apply patch 2) Create new instance with parameter --zebralang cs 3) Insert some record with basic latin characters and some with "czech" characters (for example: "č" - should be sorted after "c", "š" - should be sorted after "s") 4) Try to search in katalog (staff and opac) and sort by other field then relevance - title or author for instance 5) Records should be sorted correctly by Czech rules 6) Look at code and confirm it is ok Signed-off-by: radiuscz Signed-off-by: Jonathan Druart I did not test this patch, but trust in the author and signoffer --- Makefile.PL | 2 +- debian/scripts/koha-create | 2 +- debian/templates/koha-sites.conf | 2 +- etc/zebradb/lang_defs/cs/sort-string-utf.chr | 42 ++++++++++++++++++++++++++++ 4 files changed, 45 insertions(+), 3 deletions(-) create mode 100644 etc/zebradb/lang_defs/cs/sort-string-utf.chr diff --git a/Makefile.PL b/Makefile.PL index fd0725b..4c2f6f9 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -475,7 +475,7 @@ my %valid_config_values = ( 'AUTH_INDEX_MODE' => { 'grs1' => 1, 'dom' => 1 }, 'BIB_INDEX_MODE' => { 'grs1' => 1, 'dom' => 1 }, 'ZEBRA_MARC_FORMAT' => { 'marc21' => 1, 'normarc' => 1, 'unimarc' => 1 }, # FIXME should generate from contents of distributation - 'ZEBRA_LANGUAGE' => { 'en' => 1, 'es' => 1, 'fr' => 1, 'gr' => 1, 'nb' => 1, 'ru' => 1, 'uk' => 1 }, # FIXME should generate from contents of distribution + 'ZEBRA_LANGUAGE' => { 'cs' => 1, 'en' => 1, 'es' => 1, 'fr' => 1, 'gr' => 1, 'nb' => 1, 'ru' => 1, 'uk' => 1 }, # FIXME should generate from contents of distribution 'ZEBRA_TOKENIZER' => { chr => 1, icu => 1 }, 'RUN_DATABASE_TESTS' => { 'yes' => 1, 'no' => 1 }, 'USE_MEMCACHED' => { 'yes' => 1, 'no' => 1 }, diff --git a/debian/scripts/koha-create b/debian/scripts/koha-create index e416c8c..a9fe29c 100755 --- a/debian/scripts/koha-create +++ b/debian/scripts/koha-create @@ -52,7 +52,7 @@ Options: --marcflavor flavor Set the MARC flavor. Valid values are marc21 (default), normarc and unimarc. --zebralang lang Choose the primary language for Zebra indexing. Valid - values are en (default), es, fr, gr, nb, ru and uk. + values are cs, en (default), es, fr, gr, nb, ru and uk. --auth-idx idx_mode Set the indexing mode for authority records. Valid values are dom (default) and grs1. --biblio-idx idx_mode Set the indexing mode for bibliographic records. diff --git a/debian/templates/koha-sites.conf b/debian/templates/koha-sites.conf index 47d5033..c954a04 100644 --- a/debian/templates/koha-sites.conf +++ b/debian/templates/koha-sites.conf @@ -27,7 +27,7 @@ DEFAULTSQL="" # default: 'marc21' ZEBRA_MARC_FORMAT="marc21" -# ZEBRA_LANGUAGE: 'en' | 'es' | 'fr' | 'nb' | 'ru' | 'uk' +# ZEBRA_LANGUAGE: 'cs' | 'en' | 'es' | 'fr' | 'nb' | 'ru' | 'uk' # Primary language for Zebra indexing # default: 'en' ZEBRA_LANGUAGE="en" diff --git a/etc/zebradb/lang_defs/cs/sort-string-utf.chr b/etc/zebradb/lang_defs/cs/sort-string-utf.chr new file mode 100644 index 0000000..126c050 --- /dev/null +++ b/etc/zebradb/lang_defs/cs/sort-string-utf.chr @@ -0,0 +1,42 @@ +# Koha's Zebra character map file for czech +# +encoding utf-8 +# Character sort order definition +lowercase {0-9}abcčdefgh(ch)ijklmnopqrřsštuvwxyzž +uppercase {0-9}ABCČDEFGH(Ch)IJKLMNOPQRŘSŠTUVWXYZŽ + +# Breaking characters +space {\001-\040}!"#$%&'\()*+,-./:;<=>?@\[\\]^_`\{|}~{\x88-\x89} + +# Characters to be considered equivalent for searching purposes. +equivalent aáä +equivalent dď +equivalent eéěë +equivalent ií +equivalent lľł +equivalent nň +equivalent oóö +equivalent sß +equivalent tť +equivalent uůúü +equivalent yý + +# Supplemental mappings +map (ä) a +map (å) a +map (ö) o +map (Ä) A +map (Å) A +map (Ö) O +map âàáäÂÀÁÄ a +map çÇ c +map ďĎ d +map êèéëÊÈÉË e +map îïíÎÏÍ i +map ľĽłŁ l +map ñňŇ n +map ôöóÔÖÓ o +map ß s +map ťŤ t +map ûùúüůÛÜÙÚŮ u +map ýÿÝŸ y -- 2.1.4