Test for preferred target and block=preferred
[pazpar2-moved-to-github.git] / src / charsets.h
1 /* This file is part of Pazpar2.
2    Copyright (C) 2006-2011 Index Data
3
4 Pazpar2 is free software; you can redistribute it and/or modify it under
5 the terms of the GNU General Public License as published by the Free
6 Software Foundation; either version 2, or (at your option) any later
7 version.
8
9 Pazpar2 is distributed in the hope that it will be useful, but WITHOUT ANY
10 WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12 for more details.
13
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, write to the Free Software
16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
17
18 */
19
20 /** \file charsets.h
21     \brief Pazpar2 Character set facilities
22 */
23
24 #ifndef PAZPAR_CHARSETS_H
25 #define PAZPAR_CHARSETS_H
26
27 #include <yaz/wrbuf.h>
28 #include <yaz/xmltypes.h>
29
30 struct icu_chain;
31
32 typedef struct pp2_charset_s *pp2_charset_t;
33 typedef struct pp2_relevance_token_s *pp2_relevance_token_t;
34
35 pp2_charset_t pp2_charset_create_xml(xmlNode *xml_node);
36 pp2_charset_t pp2_charset_create(struct icu_chain * icu_chn);
37 pp2_charset_t pp2_charset_create_a_to_z(void);
38
39 void pp2_charset_destroy(pp2_charset_t pct);
40 void pp2_charset_incref(pp2_charset_t pct);
41
42 pp2_relevance_token_t pp2_relevance_tokenize(pp2_charset_t pct);
43 void pp2_relevance_first(pp2_relevance_token_t prt,
44                          const char *buf,
45                          int skip_article);
46
47 void pp2_relevance_token_destroy(pp2_relevance_token_t prt);
48 const char *pp2_relevance_token_next(pp2_relevance_token_t prt);
49 const char *pp2_get_sort(pp2_relevance_token_t prt);
50
51 #if 0
52 typedef int pp2_charset_normalize_t(pp2_charset_t pct,
53                                     const char *buf,
54                                     WRBUF norm_str, WRBUF sort_str,
55                                     int skip_article);
56
57 pp2_charset_normalize_t pp2_charset_metadata_norm;
58 #endif
59
60 #endif
61
62 /*
63  * Local variables:
64  * c-basic-offset: 4
65  * c-file-style: "Stroustrup"
66  * indent-tabs-mode: nil
67  * End:
68  * vim: shiftwidth=4 tabstop=8 expandtab
69  */
70