/* Search in factors hash table */
w = g_hash_table_lookup (cfg->factors, fuzzy_module_ctx->symbol);
+
if (w == NULL) {
- register_symbol (&metric->cache, fuzzy_module_ctx->symbol, 1, fuzzy_symbol_callback, NULL);
+ if (fabs (fuzzy_module_ctx->max_score) < 0.001) {
+ register_symbol (&metric->cache, fuzzy_module_ctx->symbol, 1, fuzzy_symbol_callback, NULL);
+ }
+ else {
+ register_symbol (&metric->cache, fuzzy_module_ctx->symbol, fuzzy_module_ctx->max_score, fuzzy_symbol_callback, NULL);
+ }
}
else {
- register_symbol (&metric->cache, fuzzy_module_ctx->symbol, *w, fuzzy_symbol_callback, NULL);
+ if (fabs (fuzzy_module_ctx->max_score) < 0.001) {
+ register_symbol (&metric->cache, fuzzy_module_ctx->symbol, *w, fuzzy_symbol_callback, NULL);
+ }
+ else {
+ register_symbol (&metric->cache, fuzzy_module_ctx->symbol, *w * fuzzy_module_ctx->max_score, fuzzy_symbol_callback, NULL);
+ }
}
register_custom_controller_command ("fuzzy_add", fuzzy_add_handler, TRUE, TRUE);
res = FALSE;
}
}
-
+ else {
+ msg_err ("unknown variable type for %s", cur->param);
+ res = FALSE;
+ }
+
+ if ( !res) {
+ /* Stop on errors */
+ break;
+ }
+
/* Search in factors hash table */
w = g_hash_table_lookup (cfg->factors, cur->param);
if (w == NULL) {