Temporarily removed --dialog option

This commit is contained in:
Daniel Wolf 2016-05-17 13:52:18 +02:00
parent 2f31c5aa61
commit bbc933a821
3 changed files with 2 additions and 9 deletions

View File

@ -88,7 +88,6 @@ int main(int argc, char *argv[]) {
tclap::ValuesConstraint<logging::Level> logLevelConstraint(logLevels); tclap::ValuesConstraint<logging::Level> logLevelConstraint(logLevels);
tclap::ValueArg<logging::Level> logLevel("", "logLevel", "The minimum log level to log", false, logging::Level::Debug, &logLevelConstraint, cmd); tclap::ValueArg<logging::Level> logLevel("", "logLevel", "The minimum log level to log", false, logging::Level::Debug, &logLevelConstraint, cmd);
tclap::ValueArg<string> logFileName("", "logFile", "The log file path.", false, string(), "string", cmd); tclap::ValueArg<string> logFileName("", "logFile", "The log file path.", false, string(), "string", cmd);
tclap::ValueArg<string> dialog("d", "dialog", "The text of the dialog.", false, string(), "string", cmd);
auto exportFormats = vector<ExportFormat>(ExportFormatConverter::get().getValues()); auto exportFormats = vector<ExportFormat>(ExportFormatConverter::get().getValues());
tclap::ValuesConstraint<ExportFormat> exportFormatConstraint(exportFormats); tclap::ValuesConstraint<ExportFormat> exportFormatConstraint(exportFormats);
tclap::ValueArg<ExportFormat> exportFormat("f", "exportFormat", "The export format.", false, ExportFormat::TSV, &exportFormatConstraint, cmd); tclap::ValueArg<ExportFormat> exportFormat("f", "exportFormat", "The export format.", false, ExportFormat::TSV, &exportFormatConstraint, cmd);
@ -118,7 +117,6 @@ int main(int argc, char *argv[]) {
ProgressBar progressBar; ProgressBar progressBar;
phones = detectPhones( phones = detectPhones(
createAudioStream(inputFileName.getValue()), createAudioStream(inputFileName.getValue()),
dialog.isSet() ? dialog.getValue() : boost::optional<string>(),
progressBar); progressBar);
} }
std::cerr << "Done" << std::endl; std::cerr << "Done" << std::endl;

View File

@ -292,7 +292,6 @@ BoundedTimeline<Phone> getPhoneAlignment(
BoundedTimeline<Phone> detectPhones( BoundedTimeline<Phone> detectPhones(
unique_ptr<AudioStream> audioStream, unique_ptr<AudioStream> audioStream,
boost::optional<std::string> dialog,
ProgressSink& progressSink) ProgressSink& progressSink)
{ {
// Pocketsphinx doesn't like empty input // Pocketsphinx doesn't like empty input
@ -319,13 +318,11 @@ BoundedTimeline<Phone> detectPhones(
auto recognizer = createSpeechRecognizer(*config.get()); auto recognizer = createSpeechRecognizer(*config.get());
ProgressMerger progressMerger(progressSink); ProgressMerger progressMerger(progressSink);
ProgressSink& wordRecognitionProgressSink = progressMerger.addSink(dialog ? 0.0 : 1.0); ProgressSink& wordRecognitionProgressSink = progressMerger.addSink(1.0);
ProgressSink& alignmentProgressSink = progressMerger.addSink(0.5); ProgressSink& alignmentProgressSink = progressMerger.addSink(0.5);
// Get words // Get words
vector<string> words = dialog vector<string> words = recognizeWords(audioStream->clone(true), *recognizer.get(), wordRecognitionProgressSink);
? extractDialogWords(*dialog)
: recognizeWords(audioStream->clone(true), *recognizer.get(), wordRecognitionProgressSink);
// Look up words in dictionary // Look up words in dictionary
vector<s3wid_t> wordIds = getWordIds(words, *recognizer->dict); vector<s3wid_t> wordIds = getWordIds(words, *recognizer->dict);

View File

@ -4,10 +4,8 @@
#include "audio/AudioStream.h" #include "audio/AudioStream.h"
#include "Phone.h" #include "Phone.h"
#include "progressBar.h" #include "progressBar.h"
#include <boost/optional/optional.hpp>
#include "BoundedTimeline.h" #include "BoundedTimeline.h"
BoundedTimeline<Phone> detectPhones( BoundedTimeline<Phone> detectPhones(
std::unique_ptr<AudioStream> audioStream, std::unique_ptr<AudioStream> audioStream,
boost::optional<std::string> dialog,
ProgressSink& progressSink); ProgressSink& progressSink);