summaryrefslogtreecommitdiff
path: root/match.c
diff options
context:
space:
mode:
authorJohn Hawthorn <john.hawthorn@gmail.com>2014-09-18 17:28:21 -0700
committerJohn Hawthorn <john.hawthorn@gmail.com>2014-09-18 17:28:21 -0700
commit00e8069b4e228af1bf3e2ae282f368676efbe0db (patch)
tree25c9a67c9e016cd87bd6ac3bf792a6dd2d1ad450 /match.c
parent23b369a57c05d863eb5c2f471f52359fe287b17f (diff)
Move scoring constants into config.h
Diffstat (limited to 'match.c')
-rw-r--r--match.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/match.c b/match.c
index 2721179..7e56072 100644
--- a/match.c
+++ b/match.c
@@ -7,6 +7,8 @@
#include "match.h"
+#include "config.h"
+
int has_match(const char *needle, const char *haystack){
while(*needle){
char nch = tolower(*needle++);
@@ -75,15 +77,6 @@ double calculate_score(const char *needle, const char *haystack, size_t *positio
* M[][] Stores the best possible score at this position.
*/
-#define SCORE_GAP_LEADING -0.005
-#define SCORE_GAP_TRAILING -0.005
-#define SCORE_GAP_INNER -0.01
-#define SCORE_MATCH_CONSECUTIVE 1.0
-#define SCORE_MATCH_SLASH 0.9
-#define SCORE_MATCH_WORD 0.8
-#define SCORE_MATCH_CAPITAL 0.7
-#define SCORE_MATCH_DOT 0.6
-
/* Which positions are beginning of words */
char last_ch = '\0';
for(int i = 0; i < m; i++){