diff options
author | Barry Haddow <barry.haddow@gmail.com> | 2014-02-07 00:15:25 +0400 |
---|---|---|
committer | Barry Haddow <barry.haddow@gmail.com> | 2014-02-07 00:15:25 +0400 |
commit | ffd7af1168be694f2416597c60dbb965c1a3f70e (patch) | |
tree | 21bb0a59e05e6881a62a3cf0df9f6d37e867e70c /moses-cmd | |
parent | 65811a032568931cf09656574edc4bd8e5cda1ce (diff) |
Fixes to hypergraph and htk outputs, better cmd line help.
Mixing boost paths and strings is bad.
Leaks in htk output.
assert that should be an exception
Diffstat (limited to 'moses-cmd')
-rw-r--r-- | moses-cmd/Main.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/moses-cmd/Main.cpp b/moses-cmd/Main.cpp index f5f52583c..eb5b5c35a 100644 --- a/moses-cmd/Main.cpp +++ b/moses-cmd/Main.cpp @@ -180,6 +180,7 @@ public: } else { TRACE_ERR("Cannot output HTK standard lattice for line " << m_lineNumber << " because the output file is not open or not ready for writing" << std::endl); } + delete file; } // Output search graph in hypergraph format for Kenneth Heafield's lazy hypergraph decoder @@ -233,7 +234,7 @@ public: } else { stringstream hypergraphDirName; - hypergraphDirName << boost::filesystem::current_path() << "/hypergraph"; + hypergraphDirName << boost::filesystem::current_path().string() << "/hypergraph"; hypergraphDir = hypergraphDirName.str(); } } @@ -527,9 +528,7 @@ size_t OutputFeatureWeightsForHypergraph(size_t index, const FeatureFunction* ff } return index+numScoreComps; } else { - cerr << "Sparse features are not yet supported when outputting hypergraph format" << endl; - assert(false); - return 0; + UTIL_THROW2("Sparse features are not yet supported when outputting hypergraph format"); } } @@ -641,7 +640,7 @@ int main(int argc, char** argv) boost::filesystem::path nbestPath(nbestFile); weightsFilename << nbestPath.parent_path().filename() << "/weights"; } else { - weightsFilename << boost::filesystem::current_path() << "/hypergraph/weights"; + weightsFilename << boost::filesystem::current_path().string() << "/hypergraph/weights"; } } boost::filesystem::path weightsFilePath(weightsFilename.str()); |