public static void readRelevanceJudgments(String p,
			HashMap<String, HashMap<Integer, Double>> relevance_judgments,
			HashMap<String, HashMap<Integer, Double>> scored_judgments) {
		try {
			BufferedReader reader = new BufferedReader(new FileReader(p));
			try {
				String line = null;
				while ((line = reader.readLine()) != null) {
					// parse the query,did,relevance line
					Scanner s = new Scanner(line).useDelimiter("\t");
					String query = s.next();
					int did = Integer.parseInt(s.next());
					String grade = s.next();
					double relScore = 1.0; // un-judged document
					double rel = 0.0; // un-judged document
					// convert to binary relevance
					if (grade.equals("Perfect")) {
						relScore = 5.0;
						rel = 1.0;
					} else if (grade.equals("Excellent")) {
						relScore = 4.0;
						rel = 1.0;
					} else if (grade.equals("Good")) {
						relScore = 3.0;
						rel = 1.0;
					} else if (grade.equals("Fair")) {
						relScore = 2.0;
						rel = 0.0;
					} else if (grade.equals("Bad")) {
						relScore = 1.0;
						rel = 0.0;
					}
					if (relevance_judgments.containsKey(query) == false) {
						HashMap<Integer, Double> qr = new HashMap<Integer, Double>();
						relevance_judgments.put(query, qr);

						HashMap<Integer, Double> qr_scored = new HashMap<Integer, Double>();
						scored_judgments.put(query, qr_scored);
					}

					HashMap<Integer, Double> qr = relevance_judgments
							.get(query);
					qr.put(did, rel);

					HashMap<Integer, Double> qr_scored = scored_judgments
							.get(query);
					qr_scored.put(did, relScore);
				}
			} finally {
				reader.close();
			}
		} catch (IOException ioe) {
			System.err.println("Oops " + ioe.getMessage());
		}
	}