Functional code in Python for creating Hidden Markov Models. Supervised learning is possible. All functions uses extended logarithmic and exponential functions to avoid overflow when working with longer chains. Based on Tobias P. Mann's and Mark Stamp's mutually exclusive thesis'.