module NLP.Scoring.SimpleUnigram where
import Data.HashTable.IO (BasicHashTable)
import qualified Data.HashTable.IO as H
import System.IO.Unsafe (unsafePerformIO)
import NLP.Alphabet.IMMC
scoreUnigram :: SimpleScoring -> IMMC -> IMMC -> Double
scoreUnigram SimpleScoring {..} x y =
maybe (if x==y then defMatch else defMismatch)
id
(unsafePerformIO $ H.lookup simpleScore (x,y))
data SimpleScoring = SimpleScoring
{ simpleScore :: !(BasicHashTable (IMMC,IMMC) Double)
, gapScore :: !Double
, gapOpen :: !Double
, gapExtend :: !Double
, defMatch :: !Double
, defMismatch :: !Double
}
deriving (Show)