Difficulty in understanding Hidden Markov Model for syntax parsing using Viterbi algorithm I intend to apply Kevin Murphy's Hidden markov model (HMM) toolbox. I have a set of production rules(arbitrary) $A_0 \to AB [p=1]$, $A\to aC [p=1]$, $B\to bbC [p=0.5]$, $B\to b [p=0.5]$ where $A_0$ is the start symbol, A, B, C are the non terminals, and a and b are the terminals and the probabilities are put in brackets. The observation is {aabc}. 
I do not know how to use the Viterbi parsing algorithm and cannot understand what all values in the parameters to use in the toolbox. Can anyone explain with a simple example how to use the program so as to select a maximum likelihood parse and how to train?
The objective is to classify a language or a text string. Any other example apart from  language would also help. Primary question is how to feed in all these data in the toolbox so as to train the HMM and how to use it for the task since evrything in it uses rand function, how do I customize it?


*

*Number of states Q=4 ? ($A_0$, A, B, C)

*Number of observation symbols of length T=4; number of sequences nex=1?

 A: yeah ok. i've just done some work on it. i've managed to make it done even if i haven't got all math beyound.
EDIT:
this is some usefull resoruces:
i've done some gesture recognition so my resources are biased for this specific application but you could find a sequence classification frameworks behind it.

*

*some good slides

*some other good slides with  good example and MATLAB code in the last ones

*a good link with MATLAB/OCTAVE code for gesture recognition

*another good link with clear, easy-to-understan, with all source code in c#. in this, also, there is as an example a basic sequence classifier and there it shows some train values and the log probability for some new sequences.

to let my work done i've grabbed the initial values (the alphabet and number of hidden states == the size of the matrixes) from this and then i've played with them.
i've also rewritten the little part of kevin murphy matlab code in c++ using armadillo library for linear algebra (matrix) calculi. if you are interested in it just let me know.
hope it helps.
