- struct icu_chain_step * step = 0;
- struct icu_chain * chain
- = icu_chain_create((uint8_t *) "en:sentence", (uint8_t *) "en");
-/* step = icu_chain_insert_step(chain, ICU_chain_step_type_normalize, */
-/* (const uint8_t *) "[:Control:] Any-Remove", */
-/* &status); */
+ //struct icu_chain_step * step = 0;
+ struct icu_chain * chain = 0;
+
+
+ const char * xml_str = "<icu_chain id=\"en:word\" locale=\"en\">"
+ "<normalize rule=\"[:Control:] Any-Remove\"/>"
+ "<tokenize rule=\"l\"/>"
+ "<normalize rule=\"[[:WhiteSpace:][:Punctuation:]] Remove\"/>"
+ "<display/>"
+ "<casemap rule=\"l\"/>"
+ "<normal/>"
+ "<sort/>"
+ "</icu_chain>";
+
+
+ xmlDoc *doc = xmlParseMemory(xml_str, strlen(xml_str));
+ xmlNode *xml_node = xmlDocGetRootElement(doc);
+ YAZ_CHECK(xml_node);
+
+
+ chain = icu_chain_xml_config(xml_node, &status);
+
+#if 0
+ chain = icu_chain_create((uint8_t *) "en:word", (uint8_t *) "en");
+ step = icu_chain_insert_step(chain, ICU_chain_step_type_normalize,
+ (const uint8_t *) "[:Control:] Any-Remove",
+ &status);
+ step = icu_chain_insert_step(chain, ICU_chain_step_type_tokenize,
+ (const uint8_t *) "s",
+ &status);