3 ms·
Here's the core code, if you really want to know: (defn score [s] (let [s1 (st/lower-case s) s2 (remove-nonstandard s1)
by drcode 4y ago
Here's the core code, if you really want to know:
(defn score [s]
(let [s1 (st/lower-case s)
s2 (remove-nonstandard s1)
s3 (remove-numbers s2)
splits (split-words s3)
all-words? (= (count s3) (count (apply str splits)))]
(cond-> {}
all-words? (assoc :all-words 0)
true (assoc :num
(* (count s)
(if all-words?
-60
-100)))
(names s3) (assoc :names 1000)
(and (dictionary s3) (not (names s3))) (assoc :dictionary 1000)
(not= (count s2) (count s3)) (assoc :numbers -500)
(not= (count s1) (count s2)) (assoc :nonstandard -500))))
- drcode 4y agoI think the percentile code doesn't attempt to accurately handle identical scores and will give sloppy results in that case, so even if 24% have the same score it will report 24%