- wrbuf_printf(w, "%s: mult[%d] += local_mult(%d) / (1+log2(1+lead_decay(%f) * length(%d)));\n", e->display_str, res, local_mult, lead_decay, length);
+ wrbuf_printf(w, "%s: mult[%d] += local_mult(%d) / "
+ "(1+log2(1+lead_decay(%f) * length(%d)));\n",
+ e->display_str, res, local_mult, lead_decay, length);
+ j = res - 1;
+ if (j > 0 && r->term_pos[j])
+ {
+ int d = length + 1 - r->term_pos[j];
+ mult[res] += mult[res] * r->follow_factor / (1 + log2(d));
+ wrbuf_printf(w, "%s: mult[%d] += mult[%d](%d) * follow(%f) / "
+ "(1+log2(d(%d));\n",
+ e->display_str, res, res, mult[res],
+ r->follow_factor, d);
+ }
+ for (j = 0; j < r->vec_len; j++)
+ r->term_pos[j] = j < res ? 0 : length + 1;