Efficient discrete symbol hidden Markov model evaluation using transformation and state reduction