public static Double[] calculatePrecisionAndRecall() {

        Double[] precisionAndRecall = new Double[2];

        double relevantDocumentsRetrieved = 0;
        double totalRetrievedDocuments = resultsDocPairs.size();

        Iterator it = resultsDocPairs.entrySet().iterator();
        while (it.hasNext()) {
            Map.Entry termEntry = (Map.Entry) it.next();
            for (int i = 0; i < knownPlagiarism.size(); i++) {

                if (termEntry.getKey().equals(knownPlagiarism.get(i))) {
                    relevantDocumentsRetrieved++;
                }
            }
        }

        double precision = ((relevantDocumentsRetrieved / totalRetrievedDocuments) * 100);
        double recall = ((relevantDocumentsRetrieved / (knownPlagiarism.size() / 2)) * 100);

        precisionAndRecall[PRECISION] = precision;
        precisionAndRecall[RECALL] = recall;

        return precisionAndRecall;

    }