diff options
author | Calvin <calvin@EESI> | 2013-05-28 10:47:11 -0400 |
---|---|---|
committer | Calvin <calvin@EESI> | 2013-05-28 10:47:11 -0400 |
commit | dd38d0d1dda2be42bf280aeca110542f2f2fef1b (patch) | |
tree | c921dc0690e29f1b7b913aaa72b9c12539faa5a1 /src/nbc/score.sml | |
parent | 2f33e34ae06b96c3f3e4456ce960172903f60bfb (diff) |
removed files
Diffstat (limited to 'src/nbc/score.sml')
-rw-r--r-- | src/nbc/score.sml | 30 |
1 files changed, 0 insertions, 30 deletions
diff --git a/src/nbc/score.sml b/src/nbc/score.sml deleted file mode 100644 index 90d569a..0000000 --- a/src/nbc/score.sml +++ /dev/null @@ -1,30 +0,0 @@ -signature SCORE = sig - val score: int * real * (string -> int option) * real * string -> real -end - -structure Score :> SCORE = struct - fun |> (x, f) = f x - infix |> - - fun addCount (hitsum, fcount, gcount, totalWords) = - Kahan.add (hitsum, Real.fromInt fcount * Math.ln (Real.fromInt gcount / totalWords)) - fun addNmer (totalWords, getGenomeCount) (nmer, ref fcount, (misses, anyhits, hitsum)) = - case getGenomeCount nmer of - NONE => (misses + 1, anyhits, hitsum) - | SOME gcount => ( - misses, true - , addCount (hitsum, fcount, gcount, totalWords) - ) - fun score (order, missConstant, getGenomeCount, totalWords, fragment) = - let - val add = addNmer (totalWords, getGenomeCount) - val seed = (0, false, Kahan.zero) - val (misses, anyhits, hitsum) = - Nmer.count (order, fragment) |> HashTable.foldi add seed - in - if anyhits then - Kahan.add (hitsum, Math.ln missConstant * Real.fromInt misses) - |> Kahan.sum - else Real.negInf - end -end |