The posterior Viterbi: a new decoding algorithm for Hidden Markov Models