class JaccardSimilarity implements Similarity {

  @Override
  public double computeScore(Collection<TermId> query, Collection<TermId> target) {
    final Set<TermId> termIdsQuery = ontology.getAllAncestorTermIds(query, false);
    final Set<TermId> termIdsTarget = ontology.getAllAncestorTermIds(target, false);

    double intersectionSize = Sets.intersection(termIdsQuery, termIdsTarget).size();
    if (normalized) {
      return intersectionSize / Sets.union(termIdsQuery, termIdsTarget).size();
    } else {
      return intersectionSize;
    }
  }

  public  JaccardSimilarity(Ontology ontology);
  public  JaccardSimilarity(Ontology ontology, boolean normalized);

}