Groonga 3.0.9 Source Code Document
Main Page
Related Pages
Namespaces
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
groonga
lib
token.h
Go to the documentation of this file.
1
/* -*- c-basic-offset: 2 -*- */
2
/* Copyright(C) 2009 Brazil
3
4
This library is free software; you can redistribute it and/or
5
modify it under the terms of the GNU Lesser General Public
6
License version 2.1 as published by the Free Software Foundation.
7
8
This library is distributed in the hope that it will be useful,
9
but WITHOUT ANY WARRANTY; without even the implied warranty of
10
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11
Lesser General Public License for more details.
12
13
You should have received a copy of the GNU Lesser General Public
14
License along with this library; if not, write to the Free Software
15
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
*/
17
#ifndef GRN_TOKEN_H
18
#define GRN_TOKEN_H
19
20
#ifndef GROONGA_IN_H
21
#include "
groonga_in.h
"
22
#endif
/* GROONGA_IN_H */
23
24
#ifndef GRN_CTX_H
25
#include "
ctx.h
"
26
#endif
/* GRN_CTX_H */
27
28
#ifndef GRN_DB_H
29
#include "
db.h
"
30
#endif
/* GRN_DB_H */
31
32
#ifndef GRN_STR_H
33
#include "
str.h
"
34
#endif
/* GRN_STR_H */
35
36
#ifdef __cplusplus
37
extern
"C"
{
38
#endif
39
40
typedef
enum
{
41
GRN_TOKEN_GET
= 0,
42
GRN_TOKEN_ADD
,
43
GRN_TOKEN_DEL
44
}
grn_token_mode
;
45
46
typedef
enum
{
47
GRN_TOKEN_DOING
= 0,
48
GRN_TOKEN_DONE
,
49
GRN_TOKEN_NOT_FOUND
50
}
grn_token_status
;
51
52
typedef
struct
{
53
grn_obj
*
table
;
54
const
unsigned
char
*
orig
;
55
const
unsigned
char
*
curr
;
56
uint32_t
orig_blen
;
57
uint32_t
curr_size
;
58
int32_t
pos
;
59
grn_token_mode
mode
;
60
grn_token_status
status
;
61
uint8_t
force_prefix
;
62
grn_obj_flags
table_flags
;
63
grn_encoding
encoding
;
64
grn_obj
*
tokenizer
;
65
grn_proc_ctx
pctx
;
66
uint32_t
variant
;
67
grn_obj
*
nstr
;
68
}
grn_token
;
69
70
extern
grn_obj
*
grn_token_uvector
;
71
72
grn_rc
grn_token_init
(
void
);
73
grn_rc
grn_token_fin
(
void
);
74
75
#define GRN_TOKEN_ENABLE_TOKENIZED_DELIMITER (0x01L<<0)
76
77
GRN_API
grn_token
*
grn_token_open
(
grn_ctx
*ctx,
grn_obj
*table,
const
char
*str,
78
size_t
str_len,
grn_token_mode
mode,
79
unsigned
int
flags);
80
81
GRN_API
grn_id
grn_token_next
(
grn_ctx
*ctx,
grn_token
*ng);
82
GRN_API
grn_rc
grn_token_close
(
grn_ctx
*ctx,
grn_token
*ng);
83
84
grn_rc
grn_db_init_mecab_tokenizer
(
grn_ctx
*ctx);
85
grn_rc
grn_db_init_builtin_tokenizers
(
grn_ctx
*ctx);
86
87
#ifdef __cplusplus
88
}
89
#endif
90
91
#endif
/* GRN_TOKEN_H */
Generated on Sun Nov 10 2013 09:49:04 for Groonga 3.0.9 Source Code Document by
1.8.1.2