Matching patterns of symbols using a profile Hidden Markov Model