Pazpar2 is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
Pazpar2 is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free
typedef struct pp2_charset_s *pp2_charset_t;
static pp2_charset_t pp2_charset_create_xml(xmlNode *xml_node);
typedef struct pp2_charset_s *pp2_charset_t;
static pp2_charset_t pp2_charset_create_xml(xmlNode *xml_node);
static pp2_charset_t pp2_charset_create_a_to_z(void);
static void pp2_charset_destroy(pp2_charset_t pct);
static pp2_charset_token_t pp2_charset_tokenize(pp2_charset_t pct);
static pp2_charset_t pp2_charset_create_a_to_z(void);
static void pp2_charset_destroy(pp2_charset_t pct);
static pp2_charset_token_t pp2_charset_tokenize(pp2_charset_t pct);
/* charset handle */
struct pp2_charset_s {
const char *(*token_next_handler)(pp2_charset_token_t prt);
const char *(*get_sort_handler)(pp2_charset_token_t prt);
const char *(*get_display_handler)(pp2_charset_token_t prt);
/* charset handle */
struct pp2_charset_s {
const char *(*token_next_handler)(pp2_charset_token_t prt);
const char *(*get_sort_handler)(pp2_charset_token_t prt);
const char *(*get_display_handler)(pp2_charset_token_t prt);
static const char *pp2_charset_token_a_to_z(pp2_charset_token_t prt);
static const char *pp2_get_sort_ascii(pp2_charset_token_t prt);
static const char *pp2_get_display_ascii(pp2_charset_token_t prt);
static const char *pp2_charset_token_a_to_z(pp2_charset_token_t prt);
static const char *pp2_get_sort_ascii(pp2_charset_token_t prt);
static const char *pp2_get_display_ascii(pp2_charset_token_t prt);
#if YAZ_HAVE_ICU
static const char *pp2_charset_token_icu(pp2_charset_token_t prt);
static const char *pp2_get_sort_icu(pp2_charset_token_t prt);
static const char *pp2_get_display_icu(pp2_charset_token_t prt);
#if YAZ_HAVE_ICU
static const char *pp2_charset_token_icu(pp2_charset_token_t prt);
static const char *pp2_get_sort_icu(pp2_charset_token_t prt);
static const char *pp2_get_display_icu(pp2_charset_token_t prt);
pp2_charset_fact_add(pft, pp2_charset_create_a_to_z(), "relevance");
pp2_charset_fact_add(pft, pp2_charset_create_a_to_z(), "sort");
pp2_charset_fact_add(pft, pp2_charset_create_a_to_z(), "mergekey");
pp2_charset_fact_add(pft, pp2_charset_create_a_to_z(), "relevance");
pp2_charset_fact_add(pft, pp2_charset_create_a_to_z(), "sort");
pp2_charset_fact_add(pft, pp2_charset_create_a_to_z(), "mergekey");
-pp2_charset_t pp2_charset_create_a_to_z(void)
-{
- pp2_charset_t pct = pp2_charset_create(0);
- pct->token_next_handler = pp2_charset_token_a_to_z;
- return pct;
-}
-
-pp2_charset_t pp2_charset_create(struct icu_chain *icu_chn)
+pp2_charset_t pp2_charset_create(void)
{
pp2_charset_t pct = xmalloc(sizeof(*pct));
pct->token_next_handler = pp2_charset_token_null;
pct->get_sort_handler = pp2_get_sort_ascii;
pct->get_display_handler = pp2_get_display_ascii;
{
pp2_charset_t pct = xmalloc(sizeof(*pct));
pct->token_next_handler = pp2_charset_token_null;
pct->get_sort_handler = pp2_get_sort_ascii;
pct->get_display_handler = pp2_get_display_ascii;
+#endif // YAZ_HAVE_ICU
+ return pct;
+}
+
+pp2_charset_t pp2_charset_create_a_to_z(void)
+{
+ pp2_charset_t pct = pp2_charset_create();
+ pct->token_next_handler = pp2_charset_token_a_to_z;
+ return pct;
+}
+
+#if YAZ_HAVE_ICU
+pp2_charset_t pp2_charset_create_icu(struct icu_chain *icu_chn)
+{
+ pp2_charset_t pct = pp2_charset_create();
pct->token_next_handler = pp2_charset_token_icu;
pct->get_sort_handler = pp2_get_sort_icu;
pct->get_display_handler = pp2_get_display_icu;
pct->token_next_handler = pp2_charset_token_icu;
pct->get_sort_handler = pp2_get_sort_icu;
pct->get_display_handler = pp2_get_display_icu;
#define raw_char(c) (((c) >= 'a' && (c) <= 'z') ? (c) : -1)
/* original tokenizer with our tokenize interface, but we
add +1 to ensure no '\0' are in our string (except for EOF)
#define raw_char(c) (((c) >= 'a' && (c) <= 'z') ? (c) : -1)
/* original tokenizer with our tokenize interface, but we
add +1 to ensure no '\0' are in our string (except for EOF)