species_id/test/DocSimilarityTest.cc
TEST_F(PerspectiveGeometryTest, LessThan5CommonTerms) {
  EXPECT_DOUBLE_EQ(reranker.CalcNewSimilarity(*docA, *docB, 0.32), 0.32);
  docA->AddTerm(1, 1.0, 30.0, 30.0);
  EXPECT_DOUBLE_EQ(reranker.CalcNewSimilarity(*docA, *docB, 0.32), 0.32);
  docB->AddTerm(2, 1.0, 25.0, 23.1);
  EXPECT_DOUBLE_EQ(reranker.CalcNewSimilarity(*docA, *docB, 0.32), 0.32);
  docB->AddTerm(3, 1.0, 34.7, 28.0);
  EXPECT_DOUBLE_EQ(reranker.CalcNewSimilarity(*docA, *docB, 0.32), 0.32);
  docB->AddTerm(4, 1.0, 10.6, 40.1);
  EXPECT_DOUBLE_EQ(reranker.CalcNewSimilarity(*docA, *docB, 0.32), 0.32);
  docB->AddTerm(5, 1.0, 60.1, 23.8);
  EXPECT_DOUBLE_EQ(reranker.CalcNewSimilarity(*docA, *docB, 0.32), 0.32);
  
}
// If there are less than 6 common terms, we can't do a perspective
// transform, so the similarity shouldn't change.
If there are less than 6 common terms, we can't do a perspective
transform, so the similarity shouldn't change.
If there are less than 6 common terms we can ' t do a perspective transform so the similarity shouldn ' t change .
TEST_F(PerspectiveGeometryTest, LessThan5CommonTerms) {
  EXPECT_DOUBLE_EQ(reranker.CalcNewSimilarity(*docA, *docB, 0.32), 0.32);
  docA->AddTerm(1, 1.0, 30.0, 30.0);
  EXPECT_DOUBLE_EQ(reranker.CalcNewSimilarity(*docA, *docB, 0.32), 0.32);
  docB->AddTerm(2, 1.0, 25.0, 23.1);
  EXPECT_DOUBLE_EQ(reranker.CalcNewSimilarity(*docA, *docB, 0.32), 0.32);
  docB->AddTerm(3, 1.0, 34.7, 28.0);
  EXPECT_DOUBLE_EQ(reranker.CalcNewSimilarity(*docA, *docB, 0.32), 0.32);
  docB->AddTerm(4, 1.0, 10.6, 40.1);
  EXPECT_DOUBLE_EQ(reranker.CalcNewSimilarity(*docA, *docB, 0.32), 0.32);
  docB->AddTerm(5, 1.0, 60.1, 23.8);
  EXPECT_DOUBLE_EQ(reranker.CalcNewSimilarity(*docA, *docB, 0.32), 0.32);
}
TEST_F ( PerspectiveGeometryTest , LessThan5CommonTerms ) { EXPECT_DOUBLE_EQ ( reranker . CalcNewSimilarity ( * docA , * docB , 0.32 ) , 0.32 ) ; docA -> AddTerm ( 1 , 1.0 , 30.0 , 30.0 ) ; EXPECT_DOUBLE_EQ ( reranker . CalcNewSimilarity ( * docA , * docB , 0.32 ) , 0.32 ) ; docB -> AddTerm ( 2 , 1.0 , 25.0 , 23.1 ) ; EXPECT_DOUBLE_EQ ( reranker . CalcNewSimilarity ( * docA , * docB , 0.32 ) , 0.32 ) ; docB -> AddTerm ( 3 , 1.0 , 34.7 , 28.0 ) ; EXPECT_DOUBLE_EQ ( reranker . CalcNewSimilarity ( * docA , * docB , 0.32 ) , 0.32 ) ; docB -> AddTerm ( 4 , 1.0 , 10.6 , 40.1 ) ; EXPECT_DOUBLE_EQ ( reranker . CalcNewSimilarity ( * docA , * docB , 0.32 ) , 0.32 ) ; docB -> AddTerm ( 5 , 1.0 , 60.1 , 23.8 ) ; EXPECT_DOUBLE_EQ ( reranker . CalcNewSimilarity ( * docA , * docB , 0.32 ) , 0.32 ) ; }
If there are less than 6 common terms, we can't do a perspective
transform, so the similarity shouldn't change.
If there are less than 6 common terms we can ' t do a perspective transform so the similarity shouldn ' t change .