diff options
author | Hieu Hoang <hieuhoang@gmail.com> | 2015-01-14 14:07:42 +0300 |
---|---|---|
committer | Hieu Hoang <hieuhoang@gmail.com> | 2015-01-14 14:07:42 +0300 |
commit | 05ead45e71916c5763c5c4b6375e2ca6838f3995 (patch) | |
tree | c279bd4aacfb31758720ffbaf5aaf62022574a52 /moses/IOWrapper.cpp | |
parent | 91cb549ccf09fc33122f3d531f47c38ad0e99b3d (diff) |
beautify
Diffstat (limited to 'moses/IOWrapper.cpp')
-rw-r--r-- | moses/IOWrapper.cpp | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/moses/IOWrapper.cpp b/moses/IOWrapper.cpp index 2df57a674..f187d9ea6 100644 --- a/moses/IOWrapper.cpp +++ b/moses/IOWrapper.cpp @@ -103,10 +103,9 @@ IOWrapper::IOWrapper() staticData.GetParameter().SetParameter<string>(m_inputFilePath, "input-file", ""); if (m_inputFilePath.empty()) { - m_inputFile = NULL; - m_inputStream = &cin; - } - else { + m_inputFile = NULL; + m_inputStream = &cin; + } else { VERBOSE(2,"IO from File" << endl); m_inputFile = new InputFileStream(m_inputFilePath); m_inputStream = m_inputFile; @@ -131,10 +130,9 @@ IOWrapper::IOWrapper() if (staticData.GetOutputSearchGraph()) { string fileName; if (staticData.GetOutputSearchGraphExtended()) { - staticData.GetParameter().SetParameter<string>(fileName, "output-search-graph-extended", ""); - } - else { - staticData.GetParameter().SetParameter<string>(fileName, "output-search-graph", ""); + staticData.GetParameter().SetParameter<string>(fileName, "output-search-graph-extended", ""); + } else { + staticData.GetParameter().SetParameter<string>(fileName, "output-search-graph", ""); } std::ofstream *file = new std::ofstream; m_outputSearchGraphStream = file; @@ -146,19 +144,19 @@ IOWrapper::IOWrapper() m_unknownsCollector = new Moses::OutputCollector(m_unknownsStream); UTIL_THROW_IF2(!m_unknownsStream->good(), "File for unknowns words could not be opened: " << - staticData.GetOutputUnknownsFile()); + staticData.GetOutputUnknownsFile()); } if (!staticData.GetAlignmentOutputFile().empty()) { m_alignmentInfoStream = new std::ofstream(staticData.GetAlignmentOutputFile().c_str()); m_alignmentInfoCollector = new Moses::OutputCollector(m_alignmentInfoStream); UTIL_THROW_IF2(!m_alignmentInfoStream->good(), - "File for alignment output could not be opened: " << staticData.GetAlignmentOutputFile()); + "File for alignment output could not be opened: " << staticData.GetAlignmentOutputFile()); } if (staticData.GetOutputSearchGraph()) { string fileName; - staticData.GetParameter().SetParameter<string>(fileName, "output-search-graph", ""); + staticData.GetParameter().SetParameter<string>(fileName, "output-search-graph", ""); std::ofstream *file = new std::ofstream; m_outputSearchGraphStream = file; @@ -182,7 +180,7 @@ IOWrapper::IOWrapper() // wordgraph output if (staticData.GetOutputWordGraph()) { string fileName; - staticData.GetParameter().SetParameter<string>(fileName, "output-word-graph", ""); + staticData.GetParameter().SetParameter<string>(fileName, "output-word-graph", ""); std::ofstream *file = new std::ofstream; m_outputWordGraphStream = file; @@ -211,7 +209,7 @@ IOWrapper::IOWrapper() } if (staticData.GetParameter().GetParam("spe-src")) { - spe_src = new ifstream(staticData.GetParameter().GetParam("spe-src")->at(0).c_str()); + spe_src = new ifstream(staticData.GetParameter().GetParam("spe-src")->at(0).c_str()); spe_trg = new ifstream(staticData.GetParameter().GetParam("spe-trg")->at(0).c_str()); spe_aln = new ifstream(staticData.GetParameter().GetParam("spe-aln")->at(0).c_str()); } |