naoa
null+****@clear*****
Mon Feb 1 02:51:25 JST 2016
naoa 2016-02-01 02:51:25 +0900 (Mon, 01 Feb 2016) New Revision: 54ab046ac18e87ab10b6c79ec59bcd26059d8407 https://github.com/groonga/groonga/commit/54ab046ac18e87ab10b6c79ec59bcd26059d8407 Merged 2d929d3: Merge pull request #460 from naoa/pat-fussy-search Message: Fix typo fussy -> fuzzy Modified files: lib/grn_pat.h lib/pat.c test/unit/core/test-patricia-trie-search.c Modified: lib/grn_pat.h (+1 -1) =================================================================== --- lib/grn_pat.h 2016-02-01 01:03:12 +0900 (db642be) +++ lib/grn_pat.h 2016-02-01 02:51:25 +0900 (298fa30) @@ -109,7 +109,7 @@ void grn_pat_cache_disable(grn_ctx *ctx, grn_pat *pat); #define WITH_TRANSPOSITION (0x01) -GRN_API grn_rc grn_pat_fussy_search(grn_ctx *ctx, grn_pat *pat, +GRN_API grn_rc grn_pat_fuzzy_search(grn_ctx *ctx, grn_pat *pat, const void *key, unsigned int key_size, unsigned int max_size, unsigned int max_distance, int flags, grn_hash *h); Modified: lib/pat.c (+8 -8) =================================================================== --- lib/pat.c 2016-02-01 01:03:12 +0900 (f185f51) +++ lib/pat.c 2016-02-01 02:51:25 +0900 (89ac1b1) @@ -1290,13 +1290,13 @@ typedef struct { const char *key; int key_length; grn_bool can_transition; -} fussy_node; +} fuzzy_node; inline static void -_grn_pat_fussy_search(grn_ctx *ctx, grn_pat *pat, grn_id id, +_grn_pat_fuzzy_search(grn_ctx *ctx, grn_pat *pat, grn_id id, const char *key, uint32_t key_size, uint16_t *dists, uint32_t lx, - int last_check, fussy_node *last_node, + int last_check, fuzzy_node *last_node, uint32_t max_distance, int flags, grn_hash *h) { pat_node *node = NULL; @@ -1319,12 +1319,12 @@ _grn_pat_fussy_search(grn_ctx *ctx, grn_pat *pat, grn_id id, return; } } - _grn_pat_fussy_search(ctx, pat, node->lr[0], + _grn_pat_fuzzy_search(ctx, pat, node->lr[0], key, key_size, dists, lx, check, last_node, max_distance, flags, h); - _grn_pat_fussy_search(ctx, pat, node->lr[1], + _grn_pat_fuzzy_search(ctx, pat, node->lr[1], key, key_size, dists, lx, check, last_node, max_distance, flags, h); @@ -1384,7 +1384,7 @@ _grn_pat_fussy_search(grn_ctx *ctx, grn_pat *pat, grn_id id, } grn_rc -grn_pat_fussy_search(grn_ctx *ctx, grn_pat *pat, +grn_pat_fuzzy_search(grn_ctx *ctx, grn_pat *pat, const void *key, uint32_t key_size, uint32_t max_size, uint32_t max_distance, int flags, grn_hash *h) { @@ -1394,7 +1394,7 @@ grn_pat_fussy_search(grn_ctx *ctx, grn_pat *pat, uint32_t lx, len, x, y; const char *s = key; const char *e = (const char *)key + key_size; - fussy_node last_node; + fuzzy_node last_node; PAT_AT(pat, GRN_ID_NIL, node); id = node->lr[1]; @@ -1429,7 +1429,7 @@ grn_pat_fussy_search(grn_ctx *ctx, grn_pat *pat, last_node.key = NULL; last_node.key_length = 0; last_node.can_transition = GRN_TRUE; - _grn_pat_fussy_search(ctx, pat, id, + _grn_pat_fuzzy_search(ctx, pat, id, key, key_size, dists, lx, -1, &last_node, max_distance, flags, h); GRN_FREE(dists); Modified: test/unit/core/test-patricia-trie-search.c (+9 -9) =================================================================== --- test/unit/core/test-patricia-trie-search.c 2016-02-01 01:03:12 +0900 (894f31e) +++ test/unit/core/test-patricia-trie-search.c 2016-02-01 02:51:25 +0900 (a0f26fd) @@ -24,8 +24,8 @@ void data_prefix_search(void); void test_prefix_search(gconstpointer data); void data_suffix_search(void); void test_suffix_search(gconstpointer data); -void data_fussy_search(void); -void test_fussy_search(gconstpointer data); +void data_fuzzy_search(void); +void test_fuzzy_search(gconstpointer data); static GList *keys; @@ -389,7 +389,7 @@ test_suffix_search(gconstpointer data) } void -data_fussy_search(void) +data_fuzzy_search(void) { cut_add_data("nonexistence", xfix_test_data_new(GRN_END_OF_DATA, NULL, "cccc", NULL, NULL), @@ -417,7 +417,7 @@ data_fussy_search(void) } void -test_fussy_search(gconstpointer data) +test_fuzzy_search(gconstpointer data) { const grn_trie_test_data *test_data = data; const gchar key1[] = "あ"; @@ -440,11 +440,11 @@ test_fussy_search(gconstpointer data) cut_assert_create_hash(); grn_test_assert_equal_rc(test_data->expected_rc, - grn_pat_fussy_search(context, trie, - test_data->search_key, - strlen(test_data->search_key), - 0, 1, 1, - hash)); + grn_pat_fuzzy_search(context, trie, + test_data->search_key, + strlen(test_data->search_key), + 0, 1, 1, + hash)); gcut_assert_equal_list_string(test_data->expected_strings, retrieve_all_keys()); } -------------- next part -------------- HTML����������������������������...Download