[Groonga-commit] groonga/groonga [master] [suggest] include threshold value. refs #1045

Back to archive index

null+****@clear***** null+****@clear*****
2011年 8月 9日 (火) 17:52:23 JST


Kouhei Sutou	2011-08-09 08:52:23 +0000 (Tue, 09 Aug 2011)

  New Revision: 577d04a33f5529b65647ca3359dd12036ace1d5f

  Log:
    [suggest] include threshold value. refs #1045

  Modified files:
    plugins/suggest/suggest.c
    test/unit/story/test-rurema.c

  Modified: plugins/suggest/suggest.c (+1 -1)
===================================================================
--- plugins/suggest/suggest.c    2011-08-09 08:47:27 +0000 (bfbf8d4)
+++ plugins/suggest/suggest.c    2011-08-09 08:52:23 +0000 (fa7cb22)
@@ -110,7 +110,7 @@ cooccurrence_search(grn_ctx *ctx, grn_obj *items, grn_obj *items_boost, grn_id i
         pfreq = GRN_INT32_VALUE(&pair_freq);
         ifreq = GRN_INT32_VALUE(&item_freq);
         boost = GRN_INT32_VALUE(&item_boost);
-        if (pfreq > threshold && ifreq > threshold && boost >= 0) {
+        if (pfreq >= threshold && ifreq >= threshold && boost >= 0) {
           grn_rset_recinfo *ri;
           void *value;
           int32_t score = pfreq;

  Modified: test/unit/story/test-rurema.c (+3 -3)
===================================================================
--- test/unit/story/test-rurema.c    2011-08-09 08:47:27 +0000 (cfff296)
+++ test/unit/story/test-rurema.c    2011-08-09 08:52:23 +0000 (57c95a0)
@@ -108,7 +108,7 @@ test_complete_coocurrence(void)
         "--table item_rurema "
         "--column kana "
         "--types complete "
-        "--threshold 0 "
+        "--threshold 1 "
         "--query 'stりん'"));
 }
 
@@ -126,7 +126,7 @@ test_correct_coocurrence(void)
         "--table item_rurema "
         "--column kana "
         "--types correct "
-        "--threshold 0 "
+        "--threshold 1 "
         "--query 'avg'"));
 }
 
@@ -144,6 +144,6 @@ test_suggest_coocurrence(void)
         "--table item_rurema "
         "--column kana "
         "--types suggest "
-        "--threshold 0 "
+        "--threshold 1 "
         "--query 'CSV'"));
 }




Groonga-commit メーリングリストの案内
Back to archive index