#!/usr/bin/python
#encoding: utf8
import codecs
def read_file_as_dict(mapping_result_file):
	"""
 	Reads the givem mapping result file and returns
    the dictionary where the key is the synset
    and as the values are all lines from file 
    with this mapping
	"""
	mapdict = dict()
	with codecs.open(mapping_result_file, 'rt') as fin:
		for line in fin:
			spl_line = line.strip().split(';')
			if not mapdict.has_key(spl_line[0]):
				mapdict[spl_line[0]] = []
			mapdict[spl_line[0]].append(line.strip())
	return mapdict