module NLP.Semiring.ViterbiNBestDerivation where
import NLP.Semiring
import Data.List
import NLP.Semiring.Viterbi
import NLP.Semiring.ViterbiNBest
import NLP.Semiring.Prob
import NLP.Semiring.Derivation
type ViterbiNBestDerivation n m = ViterbiNBest n (Weighted Prob (Derivation m))
type ViterbiDerivation m = Viterbi (Weighted Prob (Derivation m))
getBestDerivation :: (Monoid m) => ViterbiDerivation m -> m
getBestDerivation = fromDerivation . getInfo . fromViterbi
getBestScore :: (Monoid m) => ViterbiDerivation m -> Prob
getBestScore = getWeight . fromViterbi