Constructs a markov state with the given size. The size must be greater than 0.
Checks if a counter table exists in the markov state.
Checks if a token exists in a counter table in the markov state.
Returns the counter table that corresponds to the token sequence.
Return the counter value of a token, from the counter table that corresponds to the given token sequence. If the token doesn't exist in the counter table, of the leading sequence doesn't exist in the markov state, or the length of the sequence doesn't match the size of the markov state, 0 is returned instead.
Pokes a token in the counter table that corresponds to the given leading sequence of tokens, incrementing its counter value. If the token counter have an entry in the counter table, it is created and assigned a value of 1, and if no counter table exists for the leading token sequence, one is created as well. The length of the token sequence must match the size of the markov state.
Sets the counter table for a given sequence of tokens.
Checks if the markov state is empty.
Returns a list of token sequences in the counter table.
Returns the length of the markov state.
Returns a random token from a random counter table. If either the markov state or the counter table is empty, null is returned instead.
Rebuilds the associative arrays used by the markov table.
Returns a random token that might follow the given sequence of tokens based on the markov state and the counter table that corresponds to the token sequence. If either the markov state of the corresponding counter table is empty, or the token sequence doesn't have a counter table assigned to it, null is returned instead.
Returns the size of the markov state.
Represents a table of token sequences bound to counter tables in a markov chain.