private double scoreWithNGrams(List<NGram> referenceGrams, List<NGram> myGrams) {
    // handle the edge case of an empty answer
    if (myGrams.size() == 0) {
      return 0.0; // an empty answer is definitely not correct for any reasonable question
    }
    // handle the general case
    Iterator<NGram> myGramIter = myGrams.iterator();
    double scoreCounter = 0.0;
    while (myGramIter.hasNext()) {
      NGram myGram = myGramIter.next();
      Iterator<NGram> referenceGramIter = referenceGrams.iterator();
      while (referenceGramIter.hasNext()) {
        NGram referenceGram = referenceGramIter.next();
        scoreCounter += generateNGramWeight(referenceGram, myGram);
      }
    }
    return scoreCounter / (referenceGrams.size() * myGrams.size());
  }