compare dictionary with tuple and return the best matched element