IDZEBRA  2.1.2
Data Structures | Macros | Functions
zebramap.c File Reference
#include <assert.h>
#include <stdlib.h>
#include <ctype.h>
#include <charmap.h>
#include <attrfind.h>
#include <yaz/yaz-util.h>
#include <zebramap.h>

Go to the source code of this file.

Data Structures

struct  zebra_map
 
struct  zebra_maps_s
 

Macros

#define ZEBRA_MAP_TYPE_SORT   1
 
#define ZEBRA_MAP_TYPE_INDEX   2
 
#define ZEBRA_MAP_TYPE_STATICRANK   3
 
#define ZEBRA_REPLACE_ANY   300
 
#define SE_CHARS   ";,.()-/?<> \r\n\t"
 

Functions

void zebra_maps_close (zebra_maps_t zms)
 
zebra_map_t zebra_add_map (zebra_maps_t zms, const char *index_type, int map_type)
 
static int parse_command (zebra_maps_t zms, int argc, char **argv, const char *fname, int lineno)
 
ZEBRA_RES zebra_maps_read_file (zebra_maps_t zms, const char *fname)
 
zebra_maps_t zebra_maps_open (Res res, const char *base_path, const char *profile_path)
 
void zebra_maps_define_default_sort (zebra_maps_t zms)
 
zebra_map_t zebra_map_get (zebra_maps_t zms, const char *id)
 
zebra_map_t zebra_map_get_or_add (zebra_maps_t zms, const char *id)
 
chrmaptab zebra_charmap_get (zebra_map_t zm)
 
const char ** zebra_maps_input (zebra_map_t zm, const char **from, int len, int first)
 
const char ** zebra_maps_search (zebra_map_t zm, const char **from, int len, int *q_map_match)
 
const char * zebra_maps_output (zebra_map_t zm, const char **from)
 
int zebra_maps_is_complete (zebra_map_t zm)
 
int zebra_maps_is_positioned (zebra_map_t zm)
 
int zebra_maps_is_index (zebra_map_t zm)
 
int zebra_maps_is_staticrank (zebra_map_t zm)
 
int zebra_maps_is_sort (zebra_map_t zm)
 
int zebra_maps_is_alwaysmatches (zebra_map_t zm)
 
int zebra_maps_is_first_in_field (zebra_map_t zm)
 
int zebra_maps_sort (zebra_maps_t zms, Z_SortAttributes *sortAttributes, int *numerical)
 
int zebra_maps_attr (zebra_maps_t zms, Z_AttributesPlusTerm *zapt, const char **index_type, char **search_type, char *rank_type, int *complete_flag, int *sort_flag)
 
WRBUF zebra_replace (zebra_map_t zm, const char *ex_list, const char *input_str, int input_len)
 
static int tokenize_simple (zebra_map_t zm, const char **result_buf, size_t *result_len)
 
int zebra_map_tokenize_next (zebra_map_t zm, const char **result_buf, size_t *result_len, const char **display_buf, size_t *display_len)
 
int zebra_map_tokenize_start (zebra_map_t zm, const char *buf, size_t len)
 
int zebra_maps_is_icu (zebra_map_t zm)
 

Macro Definition Documentation

#define SE_CHARS   ";,.()-/?<> \r\n\t"

Definition at line 626 of file zebramap.c.

Referenced by tokenize_simple().

#define ZEBRA_MAP_TYPE_INDEX   2

Definition at line 37 of file zebramap.c.

Referenced by parse_command(), zebra_map_get_or_add(), and zebra_maps_is_index().

#define ZEBRA_MAP_TYPE_SORT   1

Definition at line 36 of file zebramap.c.

Referenced by parse_command(), zebra_maps_define_default_sort(), and zebra_maps_is_sort().

#define ZEBRA_MAP_TYPE_STATICRANK   3

Definition at line 38 of file zebramap.c.

Referenced by parse_command(), and zebra_maps_is_staticrank().

#define ZEBRA_REPLACE_ANY   300

Definition at line 40 of file zebramap.c.

Function Documentation

static int parse_command ( zebra_maps_t  zms,
int  argc,
char **  argv,
const char *  fname,
int  lineno 
)
static
static int tokenize_simple ( zebra_map_t  zm,
const char **  result_buf,
size_t *  result_len 
)
static

Definition at line 628 of file zebramap.c.

References zebra_map::input_str, SE_CHARS, and zebra_map::simple_off.

Referenced by zebra_map_tokenize_next().

zebra_map_t zebra_add_map ( zebra_maps_t  zms,
const char *  index_type,
int  map_type 
)
chrmaptab zebra_charmap_get ( zebra_map_t  zm)
zebra_map_t zebra_map_get ( zebra_maps_t  zms,
const char *  id 
)
zebra_map_t zebra_map_get_or_add ( zebra_maps_t  zms,
const char *  id 
)
int zebra_map_tokenize_next ( zebra_map_t  zm,
const char **  result_buf,
size_t *  result_len,
const char **  display_buf,
size_t *  display_len 
)
int zebra_map_tokenize_start ( zebra_map_t  zm,
const char *  buf,
size_t  len 
)
int zebra_maps_attr ( zebra_maps_t  zms,
Z_AttributesPlusTerm *  zapt,
const char **  index_type,
char **  search_type,
char *  rank_type,
int *  complete_flag,
int *  sort_flag 
)

Definition at line 514 of file zebramap.c.

References attr_find(), attr_find_ex(), attr_init_APT(), and zebra_map::completeness.

Referenced by rpn_scan(), and rpn_search_database().

void zebra_maps_close ( zebra_maps_t  zms)
void zebra_maps_define_default_sort ( zebra_maps_t  zms)

Definition at line 348 of file zebramap.c.

References zebra_map::sort, zebra_map::u, zebra_add_map(), and ZEBRA_MAP_TYPE_SORT.

Referenced by zebra_register_open().

const char** zebra_maps_input ( zebra_map_t  zm,
const char **  from,
int  len,
int  first 
)
int zebra_maps_is_alwaysmatches ( zebra_map_t  zm)

Definition at line 484 of file zebramap.c.

References zebra_map::alwaysmatches.

Referenced by extract_add_string().

int zebra_maps_is_complete ( zebra_map_t  zm)

Definition at line 449 of file zebramap.c.

References zebra_map::completeness.

Referenced by extract_token_add(), and snippet_token_add().

int zebra_maps_is_first_in_field ( zebra_map_t  zm)
int zebra_maps_is_icu ( zebra_map_t  zm)
int zebra_maps_is_index ( zebra_map_t  zm)
int zebra_maps_is_positioned ( zebra_map_t  zm)

Definition at line 456 of file zebramap.c.

References zebra_map::positioned.

int zebra_maps_is_sort ( zebra_map_t  zm)

Definition at line 477 of file zebramap.c.

References zebra_map::type, and ZEBRA_MAP_TYPE_SORT.

Referenced by extract_add_string().

int zebra_maps_is_staticrank ( zebra_map_t  zm)

Definition at line 470 of file zebramap.c.

References zebra_map::type, and ZEBRA_MAP_TYPE_STATICRANK.

Referenced by extract_add_string().

zebra_maps_t zebra_maps_open ( Res  res,
const char *  base_path,
const char *  profile_path 
)
const char* zebra_maps_output ( zebra_map_t  zm,
const char **  from 
)

Definition at line 437 of file zebramap.c.

References chr_map_output(), zebra_map::maptab, and zebra_charmap_get().

Referenced by main(), and zebra_term_untrans().

ZEBRA_RES zebra_maps_read_file ( zebra_maps_t  zms,
const char *  fname 
)
const char** zebra_maps_search ( zebra_map_t  zm,
const char **  from,
int  len,
int *  q_map_match 
)
int zebra_maps_sort ( zebra_maps_t  zms,
Z_SortAttributes *  sortAttributes,
int *  numerical 
)

Definition at line 498 of file zebramap.c.

References attr_find(), and attr_init_AttrList().

WRBUF zebra_replace ( zebra_map_t  zm,
const char *  ex_list,
const char *  input_str,
int  input_len 
)

Definition at line 618 of file zebramap.c.

References zebra_maps_s::wrbuf_1, and zebra_map::zebra_maps.

Referenced by zebra_string_norm().