Skip to content

Commit

Permalink
Bind GRN_OP_FUZZY
Browse files Browse the repository at this point in the history
GitHub: #116
  • Loading branch information
Masafumi Yokoyama committed Mar 5, 2016
1 parent 042fbeb commit 9b70466
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ext/groonga/rb-grn-operator.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* -*- coding: utf-8; mode: C; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
Copyright (C) 2009-2015 Kouhei Sutou <[email protected]>
Copyright (C) 2016 Masafumi Yokoyama <[email protected]>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
Expand Down Expand Up @@ -224,6 +225,8 @@ rb_grn_operator_from_ruby_object (VALUE rb_operator)
operator = GRN_OP_JSON_PUT;
} else if (rb_grn_equal_option(rb_operator, "regexp")) {
operator = GRN_OP_REGEXP;
} else if (rb_grn_equal_option(rb_operator, "fuzzy")) {
operator = GRN_OP_FUZZY;
} else {
rb_raise(rb_eArgError,
"operator should be one of "
Expand Down Expand Up @@ -635,6 +638,10 @@ rb_grn_init_operator (VALUE mGrn)
rb_funcall(rb_cGrnRegexpOperator, rb_intern("new"), 2,
rb_str_new_cstr("regexp"),
UINT2NUM(GRN_OP_REGEXP)));
rb_define_const(rb_cGrnOperator, "FUZZY",
rb_funcall(rb_cGrnOperator, rb_intern("new"), 2,
rb_str_new_cstr("fuzzy"),
UINT2NUM(GRN_OP_FUZZY)));


/*
Expand Down

0 comments on commit 9b70466

Please sign in to comment.