And add a few tests for the behavior.
<term>equivalent <replaceable>value-set</replaceable></term>
<listitem>
<para>
<term>equivalent <replaceable>value-set</replaceable></term>
<listitem>
<para>
- This directive introduces equivalence classes of characters
- and/or strings for sorting purposes only. It resembles the map
- directive, but does not affect search and retrieval indexing,
- but only sorting order under present requests.
+ This directive introduces equivalence classes of strings for
+ searching purposes only. It's a one-to-many
+ conversion that takes place only during search before the map
+ directive kicks in.
- For example, <literal>scan.chr</literal> contains the following
- equivalent sorting instructions, which can be uncommented:
- # equivalent æä(ae)
- # equivalent øö(oe)
- # equivalent å(aa)
- # equivalent uü
+ <para>
+ a search for the <literal>äsel</literal> will be be match any of
+ <literal>æsel</literal>, <literal>äsel</literal> and
+ <literal>aesel</literal>.
+ </para>
</listitem></varlistentry>
</variablelist>
</para>
</listitem></varlistentry>
</variablelist>
</para>
test_icu_indexing.cfg test_icu_indexing.idx \
test_sort1.cfg test_sort1.idx test_sort1.chr sort1.abs \
test_sort2.cfg test_sort2.idx test_sort2.chr sort2.abs \
test_icu_indexing.cfg test_icu_indexing.idx \
test_sort1.cfg test_sort1.idx test_sort1.chr sort1.abs \
test_sort2.cfg test_sort2.idx test_sort2.chr sort2.abs \
- test_safari.cfg test_sort3.cfg
+ test_safari.cfg test_sort3.cfg string.chr
noinst_LIBRARIES = libtestlib.a
noinst_LIBRARIES = libtestlib.a
--- /dev/null
+# Generic character map.
+#
+
+# Define the basic value-set. *Beware* of changing this without re-indexing
+# your databases.
+
+lowercase {0-9}{a-y}üzæäøöå
+uppercase {0-9}{A-Y}ÜZÆÄØÖÅ
+
+# Breaking characters
+
+space {\001-\040}!"#$%&'\()*+,-./:;<=>?@\[\\]^_`\{|}~
+
+# Characters to be considered equivalent for searching purposes.
+
+# equivalent æä(ae)
+# equivalent øö(oe)
+equivalent å(aa)
+# equivalent uü
+
+# Supplemental mappings
+
+#map (ä) ä
+#map (æ) æ
+#map (ø) ø
+#map (å) å
+#map (ö) ö
+#map (Ä) Ä
+#map (&Aelig;) Æ
+#map (Ø) Ø
+#map (Å) Å
+#map (Ö) Ö
+
+#map éÉ e
+#map á a
+#map ó o
+#map í i
+
+#map (Aa) (AA)
+
+#map (aa) a
+ "<gils>\n"
+ "<title>"
+ "\xe5" " og vandl" "\xf8" "b"
+ "</title>"
+ "</gils>"
+ ,
0} ;
static void tst(int argc, char **argv)
0} ;
static void tst(int argc, char **argv)
YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 5=103 titl", 3));
YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 5=103 titlx", 3));
YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 5=103 titlxx", 0));
YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 5=103 titl", 3));
YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 5=103 titlx", 3));
YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 5=103 titlxx", 0));
- YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 5=103 x", 2));
+ YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 5=103 x", 3));
YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 5=103 le", 0));
YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 5=103 .*le", 3));
YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 5=103 le", 0));
YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 5=103 .*le", 3));
/* string relations, >= */
/* string relations, >= */
- YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 2=4 x", 2));
- YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 2=4 tu", 2));
- YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 2=4 title", 3));
+ YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 2=4 x", 3));
+ YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 2=4 tu", 3));
+ YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 2=4 title", 4));
/* string relations, > */
/* string relations, > */
- YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 2=5 x", 0));
- YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 2=5 tu", 2));
- YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 2=5 title", 2));
+ YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 2=5 x", 1));
+ YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 2=5 tu", 3));
+ YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 2=5 title", 3));
/* always-matches relation */
/* always-matches relation */
- YAZ_CHECK(tl_query(zh, "@attr 1=_ALLRECORDS @attr 2=103 {ym}", 6));
- YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 2=103 {x my}", 5));
+ YAZ_CHECK(tl_query(zh, "@attr 1=_ALLRECORDS @attr 2=103 {ym}", 7));
+ YAZ_CHECK(tl_query(zh, "@attr 1=4 @attr 2=103 {x my}", 6));
YAZ_CHECK(tl_query_x(zh, "@attr 1=1 @attr 2=103 {x my}", 0, 114));
/* and searches */
YAZ_CHECK(tl_query_x(zh, "@attr 1=1 @attr 2=103 {x my}", 0, 114));
/* and searches */
YAZ_CHECK(tl_query(zh, "@attr 1=30 @attr 4=5 @attr 2=5 {2107-09-19 00:00:00}", 0));
YAZ_CHECK(tl_query(zh, "@attr 1=30 @attr 4=5 @attr 2=5 {2107-09-19 00:00:00}", 0));
+ YAZ_CHECK(tl_query(zh, "@attr 1=4 {\xe5" " og vandl" "\xf8" "b}", 1));
+
+ YAZ_CHECK(tl_query(zh, "@attr 1=4 {\xc5" " OG VANDL" "\xd8" "B}", 1));
+
+ /* try equivalent directive */
+ YAZ_CHECK(tl_query(zh, "@attr 1=4 {aa" " OG VANDL" "\xd8" "B}", 1));
+ YAZ_CHECK(tl_query(zh, "@attr 1=4 {AA" " OG VANDL" "\xd8" "B}", 0));
+
YAZ_CHECK(tl_close_down(zh, zs));
}
YAZ_CHECK(tl_close_down(zh, zs));
}