Using boost::optional<T>.get_value_or() instead of value_or() for old Boost versions

This commit is contained in:
Daniel Wolf 2016-09-08 22:23:19 +02:00
parent d98de34b98
commit d4b86357cf
1 changed files with 4 additions and 0 deletions

View File

@ -18,6 +18,7 @@
#include "ContinuousTimeline.h"
#include "audio/processing.h"
#include "parallel.h"
#include <boost/version.hpp>
extern "C" {
#include <pocketsphinx.h>
@ -322,6 +323,9 @@ Timeline<Phone> utteranceToPhones(
if (wordIds.empty()) return Timeline<Phone>();
// Align the words' phones with speech
#if BOOST_VERSION < 105600 // Support legacy syntax
#define value_or get_value_or
#endif
Timeline<Phone> segmentPhones = getPhoneAlignment(wordIds, *clipSegment, decoder, alignmentProgressSink)
.value_or(ContinuousTimeline<Phone>(clipSegment->getTruncatedRange(), Phone::Noise));
segmentPhones.shift(utterance.getStart());