import codecs


def load_dictionary(filename, sep=';'):
	"""
	:param filename: A file that connects words to their respective level.
	:param sep: mark used to seperate the elements in a line. 
	:return: a dictionary that connects the words to a certain level.
	"""
	dictionary = [ ]
	for line in codecs.open(filename,'r','utf8'):
		line = line.strip()
		components = line.split(sep)
		dictionary.append(components)
	dictionary = dict(dictionary)
	return dictionary