Bug 16952: Czech language definitions for sorting in Zebra
authorJosef Moravec <josef.moravec@gmail.com>
Thu, 21 Jul 2016 05:46:23 +0000 (07:46 +0200)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 28 Oct 2016 15:33:00 +0000 (15:33 +0000)
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 <radek.siman@centrum.cz>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
I did not test this patch, but trust in the author and signoffer

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Makefile.PL
debian/scripts/koha-create
debian/templates/koha-sites.conf
etc/zebradb/lang_defs/cs/sort-string-utf.chr [new file with mode: 0644]

index fd0725b..4c2f6f9 100644 (file)
@@ -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 },
index e416c8c..a9fe29c 100755 (executable)
@@ -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.
index 47d5033..c954a04 100644 (file)
@@ -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 (file)
index 0000000..126c050
--- /dev/null
@@ -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 (&auml;)        a
+map (&aring;)       a
+map (&ouml;)        o
+map (&Auml;)        A
+map (&Aring;)       A
+map (&Ouml;)        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