What is the problem? This is almost plain English:
Let it gbe a value wordin the hash table good(or 0 if it does not exist there) 2 times
(let ((g (* 2 (or (gethash word good) 0)))
and the bvalue wordin the hash table bad(or 0 if it does not exist there).
(b (or (gethash word bad) 0)))
With this in mind, and assuming that the sum gand bnot less than 5
(unless (< (+ g b) 5)
returns a maximum of 0.01 or
(max .01
minimum 0.99 or
(min .99
b/ nbadis divided by the sum of b/ nbadand g/ ngood(as a floating point value, and these separate coefficients should be no more than 1).
(float (/ (min 1 (/ b nbad))
(+ (min 1 (/ g ngood))
(min 1 (/ b nbad)))))))))