output concordia score
Former-commit-id: fa7db09fe9319fa844d294ca4e7deb22d1328151
This commit is contained in:
parent
7549703414
commit
5c2ae86097
@ -125,7 +125,8 @@ int main(int argc, char** argv) {
|
|||||||
<< " fragments. " << "Search took: " <<
|
<< " fragments. " << "Search took: " <<
|
||||||
msdiff.total_milliseconds() << "ms." << std::endl;
|
msdiff.total_milliseconds() << "ms." << std::endl;
|
||||||
if (!cli.count("silent")) {
|
if (!cli.count("silent")) {
|
||||||
std::cout << "\tBest overlay: " << std::endl;
|
std::cout << "\tBest overlay (score="<<
|
||||||
|
result->getBestOverlayScore()<< "): " << std::endl;
|
||||||
BOOST_FOREACH(MatchedPatternFragment fragment,
|
BOOST_FOREACH(MatchedPatternFragment fragment,
|
||||||
result->getBestOverlay()) {
|
result->getBestOverlay()) {
|
||||||
std::cout << "\t\tfragment [" << fragment.getStart()
|
std::cout << "\t\tfragment [" << fragment.getStart()
|
||||||
|
@ -39,6 +39,10 @@ public:
|
|||||||
return _bestOverlay;
|
return _bestOverlay;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double getBestOverlayScore() const {
|
||||||
|
return _bestOverlayScore;
|
||||||
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void _checkPossibleOverlays(
|
void _checkPossibleOverlays(
|
||||||
std::vector<MatchedPatternFragment> currentOverlay,
|
std::vector<MatchedPatternFragment> currentOverlay,
|
||||||
|
@ -204,9 +204,10 @@ BOOST_AUTO_TEST_CASE( ConcordiaSearch1 )
|
|||||||
concordia.refreshSAfromRAM();
|
concordia.refreshSAfromRAM();
|
||||||
|
|
||||||
boost::shared_ptr<ConcordiaSearchResult> searchResult1 = concordia.concordiaSearch("posiada rysia chyba");
|
boost::shared_ptr<ConcordiaSearchResult> searchResult1 = concordia.concordiaSearch("posiada rysia chyba");
|
||||||
// best overlay: [], []
|
// best overlay: [0,2], [2,3], score =
|
||||||
|
|
||||||
BOOST_CHECK_EQUAL(searchResult1->getBestOverlay().size(), 2);
|
BOOST_CHECK_EQUAL(searchResult1->getBestOverlay().size(), 2);
|
||||||
|
BOOST_CHECK_CLOSE(searchResult1->getBestOverlayScore(), 0.695, 0.1);
|
||||||
BOOST_CHECK_EQUAL(searchResult1->getBestOverlay().at(0).getStart(), 0);
|
BOOST_CHECK_EQUAL(searchResult1->getBestOverlay().at(0).getStart(), 0);
|
||||||
BOOST_CHECK_EQUAL(searchResult1->getBestOverlay().at(0).getEnd(), 2);
|
BOOST_CHECK_EQUAL(searchResult1->getBestOverlay().at(0).getEnd(), 2);
|
||||||
BOOST_CHECK_EQUAL(searchResult1->getBestOverlay().at(1).getStart(), 2);
|
BOOST_CHECK_EQUAL(searchResult1->getBestOverlay().at(1).getStart(), 2);
|
||||||
|
Loading…
Reference in New Issue
Block a user