class CosineSimilarity 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);

    return Sets.intersection(termIdsQuery, termIdsTarget).size()
        / (Math.sqrt(termIdsQuery.size()) * Math.sqrt(termIdsTarget.size()));
  }

  public  CosineSimilarity(Ontology ontology);
  public  CosineSimilarity(Ontology ontology, boolean oppositeAware);

}