diff --git a/concordia/concordia_search_result.cpp b/concordia/concordia_search_result.cpp index 11e2284..eb525c8 100644 --- a/concordia/concordia_search_result.cpp +++ b/concordia/concordia_search_result.cpp @@ -77,7 +77,7 @@ void ConcordiaSearchResult::_checkPossibleOverlays( if (allTerminal) { double score = Utils::getLogarithmicOverlay(currentOverlay, patternSize, - 1.0); + 2.0); if (score > _bestOverlayScore) { _bestOverlay = currentOverlay; _bestOverlayScore = score; diff --git a/concordia/t/test_concordia.cpp b/concordia/t/test_concordia.cpp index b4fe963..75c98a4 100644 --- a/concordia/t/test_concordia.cpp +++ b/concordia/t/test_concordia.cpp @@ -237,10 +237,10 @@ BOOST_AUTO_TEST_CASE( ConcordiaSearch1 ) concordia.refreshSAfromRAM(); boost::shared_ptr searchResult1 = concordia.concordiaSearch("posiada rysia chyba"); - // best overlay: [0,2], [2,3], score = 0.695 + // best overlay: [0,2], [2,3], score = 0.829 BOOST_CHECK_EQUAL(searchResult1->getBestOverlay().size(), 2); - BOOST_CHECK_CLOSE(searchResult1->getBestOverlayScore(), 0.695, 0.1); + BOOST_CHECK_CLOSE(searchResult1->getBestOverlayScore(), 0.829, 0.1); BOOST_CHECK_EQUAL(searchResult1->getBestOverlay().at(0).getStart(), 0); BOOST_CHECK_EQUAL(searchResult1->getBestOverlay().at(0).getEnd(), 2); BOOST_CHECK_EQUAL(searchResult1->getBestOverlay().at(1).getStart(), 2); @@ -327,7 +327,7 @@ BOOST_AUTO_TEST_CASE( ConcordiaSearch2 ) // best overlay: BOOST_CHECK_EQUAL(searchResult1->getBestOverlay().size(), 2); - BOOST_CHECK_CLOSE(searchResult1->getBestOverlayScore(), 0.537, 0.1); + BOOST_CHECK_CLOSE(searchResult1->getBestOverlayScore(), 0.655, 0.1); BOOST_CHECK_EQUAL(searchResult1->getBestOverlay().at(0).getStart(), 1); BOOST_CHECK_EQUAL(searchResult1->getBestOverlay().at(0).getEnd(), 5); BOOST_CHECK_EQUAL(searchResult1->getBestOverlay().at(1).getStart(), 5);