Forward Algorithm (based on Viterbi) for Computing the Lexical Probabilities of Words in a Sentence.
This sample code demonstrates how to implement a probability based lexical category tagger for words in a sentence(s). This was implemented from the pseudo-code & details of Allen, J. (1995). Natural language understanding (2nd ed). Benjamin/Cummings Pub. Co. course book for the NLP course.