On Maximum a Posteriori Estimation of Hidden Markov Processes