# HG changeset patch # User Chris Cannam # Date 1353448669 0 # Node ID c06fe5350b3452ac9e6bc80d8126cbbff247bf72 # Parent 82552664d471c68d45c15d8eae1d2993b9d538c4 But don't use a mid-stream low-confidence observation to reject a good ongoing hypothesis diff -r 82552664d471 -r c06fe5350b34 NoteHypothesis.cpp --- a/NoteHypothesis.cpp Tue Nov 20 21:31:17 2012 +0000 +++ b/NoteHypothesis.cpp Tue Nov 20 21:57:49 2012 +0000 @@ -98,7 +98,9 @@ // avoid piling up a lengthy sequence of estimates that are // all acceptable but are in total not enough to cause us to // be satisfied - m_state = Rejected; + if (m_pending.empty()) { + m_state = Rejected; + } return false; } diff -r 82552664d471 -r c06fe5350b34 test/TestNoteHypothesis.cpp --- a/test/TestNoteHypothesis.cpp Tue Nov 20 21:31:17 2012 +0000 +++ b/test/TestNoteHypothesis.cpp Tue Nov 20 21:57:49 2012 +0000 @@ -73,6 +73,20 @@ BOOST_CHECK(!h.accept(e)); BOOST_CHECK_EQUAL(h.getState(), NoteHypothesis::Rejected); } + +BOOST_AUTO_TEST_CASE(noConfidenceIgnore) +{ + // But if we're already in process we don't go to rejected state, + // we just ignore this hypothesis + NoteHypothesis h; + NoteHypothesis::Estimate e; + BOOST_CHECK_EQUAL(h.getState(), NoteHypothesis::New); + BOOST_CHECK(h.accept(e)); + BOOST_CHECK_EQUAL(h.getState(), NoteHypothesis::Provisional); + e.confidence = 0; + BOOST_CHECK(!h.accept(e)); + BOOST_CHECK_EQUAL(h.getState(), NoteHypothesis::Provisional); +} BOOST_AUTO_TEST_CASE(tooSlow) {