diff options
author | Kenneth Heafield <github@kheafield.com> | 2011-11-18 16:07:41 +0400 |
---|---|---|
committer | Kenneth Heafield <github@kheafield.com> | 2011-11-18 16:07:41 +0400 |
commit | bf78f7a1acbadbab8da23502d96eb382b60a6b6e (patch) | |
tree | b3ca4bb831bf5f8ea6cd53bbadff2749faa8bca4 /moses-chart-cmd/src | |
parent | 1192e6f2b045e00fe74060277e7a797a02b53075 (diff) |
Replace assert with CHECK until people learn how to use assert properly
Diffstat (limited to 'moses-chart-cmd/src')
-rw-r--r-- | moses-chart-cmd/src/IOWrapper.cpp | 10 | ||||
-rw-r--r-- | moses-chart-cmd/src/Main.cpp | 6 |
2 files changed, 8 insertions, 8 deletions
diff --git a/moses-chart-cmd/src/IOWrapper.cpp b/moses-chart-cmd/src/IOWrapper.cpp index b5d503133..667ebdc06 100644 --- a/moses-chart-cmd/src/IOWrapper.cpp +++ b/moses-chart-cmd/src/IOWrapper.cpp @@ -152,7 +152,7 @@ InputType*IOWrapper::GetInput(InputType* inputType) */ void OutputSurface(std::ostream &out, const Phrase &phrase, const std::vector<FactorType> &outputFactorOrder, bool reportAllFactors) { - assert(outputFactorOrder.size() > 0); + CHECK(outputFactorOrder.size() > 0); if (reportAllFactors == true) { out << phrase; } else { @@ -257,7 +257,7 @@ void IOWrapper::OutputDetailedTranslationReport( } std::ostringstream out; OutputTranslationOptions(out, hypo, translationId); - assert(m_detailOutputCollector); + CHECK(m_detailOutputCollector); m_detailOutputCollector->Write(translationId, out.str()); } @@ -283,7 +283,7 @@ void IOWrapper::OutputBestHypo(const ChartHypothesis *hypo, long translationId, hypo->CreateOutputPhrase(outPhrase); // delete 1st & last - assert(outPhrase.GetSize() >= 2); + CHECK(outPhrase.GetSize() >= 2); outPhrase.RemoveWord(0); outPhrase.RemoveWord(outPhrase.GetSize() - 1); @@ -337,7 +337,7 @@ void IOWrapper::OutputNBestList(const ChartTrellisPathList &nBestList, const Cha Moses::Phrase outputPhrase = path.GetOutputPhrase(); // delete 1st & last - assert(outputPhrase.GetSize() >= 2); + CHECK(outputPhrase.GetSize() >= 2); outputPhrase.RemoveWord(0); outputPhrase.RemoveWord(outputPhrase.GetSize() - 1); @@ -438,7 +438,7 @@ void IOWrapper::OutputNBestList(const ChartTrellisPathList &nBestList, const Cha out <<std::flush; - assert(m_nBestOutputCollector); + CHECK(m_nBestOutputCollector); m_nBestOutputCollector->Write(translationId, out.str()); } diff --git a/moses-chart-cmd/src/Main.cpp b/moses-chart-cmd/src/Main.cpp index b99b0d983..03c8105ee 100644 --- a/moses-chart-cmd/src/Main.cpp +++ b/moses-chart-cmd/src/Main.cpp @@ -92,7 +92,7 @@ public: ChartManager manager(*m_source, &system); manager.ProcessSentence(); - assert(!staticData.UseMBR()); + CHECK(!staticData.UseMBR()); // 1-best const ChartHypothesis *bestHypo = manager.GetBestHypothesis(); @@ -123,7 +123,7 @@ public: std::ostringstream out; manager.GetSearchGraph(lineNumber, out); OutputCollector *oc = m_ioWrapper.GetSearchGraphOutputCollector(); - assert(oc); + CHECK(oc); oc->Write(lineNumber, out.str()); } @@ -226,7 +226,7 @@ int main(int argc, char* argv[]) exit(0); } - assert(staticData.GetSearchAlgorithm() == ChartDecoding); + CHECK(staticData.GetSearchAlgorithm() == ChartDecoding); // set up read/writing class IOWrapper *ioWrapper = GetIODevice(staticData); |