pub fn derive_log_likelihood(base_log_q4: i32, mt: MatchType) -> i32Expand description
Q4 log-likelihood derived from a match-type classification.
base_log_q4 is the producer-chosen per-engine / per-kind likelihood
floor (already in Q4 log-space) — e.g. Q4·ln(LIKELIHOOD_JP_JUKUGO_BASE).
The match-type decay is applied on top:
Exact→base_log_q4Prefix(prox_milli)→base_log_q4 + K · Q4·ln(prox/1000)withK=3Fuzzy(cost_milli)→base_log_q4 + Q4·ln(1 − cost/1000)(cost-capped at 999 to avoid-inf)Composed { links }→base_log_q4 + (links − 1) · Q4·ln(0.7)forlinks ≥ 1, elsebase_log_q4
All decays are non-positive (multiplicative factors ≤ 1.0 in linear
space), so the returned value is always ≤ base_log_q4. This is the
log-space equivalent of the v1.3 multiplicative chain
base · proximity^K · (1 − cost) · 0.7^(links − 1).