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