def build_single(sequence, state_size, state):
	"""
	A small temporary model for lower order Markov Chains called during prediction when previously unseen state is
	encountered.
	:param sequence: Sequence to learn
	:param state_size: Order of the Markov Chain
	:param state: Current state
	:return: Lower order Markov Chain
	"""
	model = {}
	for posnum in range(len(sequence) - state_size):
		if tuple(sequence[posnum:posnum + state_size]) == state:
			next = sequence[posnum + state_size]
			if state not in model.keys():
				model[state] = {}
			if next not in model[state].keys():
				model[state][next] = 0
			model[state][next] += 1
	return model