Navigation Menu

Skip to content

Commit

Permalink
token: add tokenizer token skip
Browse files Browse the repository at this point in the history
  • Loading branch information
naoa committed Aug 14, 2014
1 parent 7fc8677 commit c5ec116
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions include/groonga/tokenizer.h
Expand Up @@ -161,6 +161,8 @@ typedef unsigned int grn_tokenizer_status;
#define GRN_TOKENIZER_TOKEN_UNMATURED (0x01L<<2)
/* GRN_TOKENIZER_TOKEN_REACH_END means that ... */
#define GRN_TOKENIZER_TOKEN_REACH_END (0x01L<<3)
/* GRN_TOKENIZER_TOKEN_SKIP means that the token is skipped */
#define GRN_TOKENIZER_TOKEN_SKIP (0x01L<<4)

/*
* GRN_TOKENIZER_CONTINUE and GRN_TOKENIZER_LAST are deprecated. They
Expand Down
4 changes: 4 additions & 0 deletions lib/token.c
Expand Up @@ -579,6 +579,10 @@ grn_token_next(grn_ctx *ctx, grn_token *token)
(status & GRN_TOKENIZER_TOKEN_REACH_END)))
? GRN_TOKEN_DONE : GRN_TOKEN_DOING;
token->force_prefix = 0;
if (status & GRN_TOKENIZER_TOKEN_SKIP) {
token->pos++;
continue;
}
if (token->curr_size == 0) {
char tokenizer_name[GRN_TABLE_MAX_KEY_SIZE];
int tokenizer_name_length;
Expand Down

0 comments on commit c5ec116

Please sign in to comment.