OSDN Git Service

modified: src/recognize_extra.c
authorevgeny <evgeny@users.sourceforge.jp>
Mon, 20 Jun 2011 16:37:17 +0000 (20:37 +0400)
committerevgeny <evgeny@users.sourceforge.jp>
Mon, 20 Jun 2011 16:37:17 +0000 (20:37 +0400)
modified:   data/merge.sh
modified:   data/sort.sh

data/merge.sh
data/sort.sh
src/recognize_extra.c

index 02b9cf3..80d0fa0 100755 (executable)
@@ -7,3 +7,4 @@ shopt -s xpg_echo
 echo '\x0A\x0A\c' >> merged.txt.utf8
 crlf -d merged.txt.utf8
 (echo '\xFF\xFE\c' & iconv -f UTF8 -t UTF16LE merged.txt.utf8) > merged.txt
+rm *.utf8
index 925ef13..5f5d913 100755 (executable)
@@ -6,3 +6,4 @@ shopt -s xpg_echo
 echo '\x0A\x0A\c' >> $1.utf8_sorted
 crlf -d $1.utf8_sorted
 (echo '\xFF\xFE\c' & iconv -f UTF8 -t UTF16LE $1.utf8_sorted) > out.txt
+rm *.utf8 *_sorted
index 91dafa5..2ed5c0f 100644 (file)
@@ -127,24 +127,15 @@ gint pass_extra_filters(GList *strokes, gunichar2 *entry)
                        val[1] = eval_filter(g_list_nth_data(strokes, stroke[1] - 1), arg[1]);
                        gint sz;
                        get_sz(strokes, &sz);
+                       sc = 0;
                        if(fn == '-')
-                       {
-                           sc = ((val[0] - val[1]) < 0) ? 1 : -1;
-                           if(must) sc *= 2;
-                           score += sc;
-                       }
+                           sc = ((val[0] - val[1]) < 0) ? 1 : 0;
                        else if(fn == '=')
-                       {
-                           sc = ((val[0] - val[1]) > sz/4) ? 1 : -1;
-                           if(must) sc *= 2;
-                           score += sc;
-                       }
+                           sc = ((val[0] - val[1]) > sz/4) ? 1 : 0;
                        else if(fn == '<')
-                       {
-                           sc = (abs(val[1] - val[0]) > sz/2) ? 1 : -1;
-                           if(must) sc *= 2;
-                           score += sc;
-                       }
+                           sc = (abs(val[1] - val[0]) > sz/2) ? 1 : 0;
+                       if(must) sc *= 2;
+                       score += sc;
                    }
 
                    // reset