*/
@Override
public double sim(String concept1, String concept2, ConceptGraph cg,
int iter, double threshold, double dampingFactor) {
Map<Integer, Double> c1dv = new HashMap<Integer, Double>(1);
ConcRel c1 = cg.getConceptMap().get(concept1);
ConcRel c2 = cg.getConceptMap().get(concept2);
if (c1 == null || c2 == null)
return 0d;
c1dv.put(c1.getNodeIndex(), 1d);
double[] c1pr = this.rank2(c1dv, cg, iter, threshold, dampingFactor);
Map<Integer, Double> c2dv = new HashMap<Integer, Double>(1);
c2dv.put(c2.getNodeIndex(), 1d);
double[] c2pr = this.rank2(c2dv, cg, iter, threshold, dampingFactor);
return cosine(c1pr, c2pr);
}