diff options
author | Lane Schwartz <dowobeha@gmail.com> | 2013-04-29 20:24:44 +0400 |
---|---|---|
committer | Lane Schwartz <dowobeha@gmail.com> | 2013-04-29 20:24:44 +0400 |
commit | ef3d30146ac983fc989e5fdea8dcfc5a143b9dbd (patch) | |
tree | ef60f74f706169a7df2a2f4474367b3148e68b4f /moses-cmd/Main.cpp | |
parent | 62e1bf05d68e331ed238ec3f8a29e20e753889e9 (diff) |
Re-enabled commented out code.
Hopefully this commit will now compile on all versions of Boost.
Diffstat (limited to 'moses-cmd/Main.cpp')
-rw-r--r-- | moses-cmd/Main.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/moses-cmd/Main.cpp b/moses-cmd/Main.cpp index 188632d6b..8bf1cc58a 100644 --- a/moses-cmd/Main.cpp +++ b/moses-cmd/Main.cpp @@ -197,7 +197,29 @@ public: string nbestFile = staticData.GetNBestFilePath(); if ( ! nbestFile.empty() && nbestFile!="-" && !boost::starts_with(nbestFile,"/dev/stdout") ) { boost::filesystem::path nbestPath(nbestFile); - //hypergraphDir = nbestPath.parent_path().filename().native(); + + // In the Boost filesystem API version 2, + // which was the default prior to Boost 1.46, + // the filename() method returned a string. + // + // In the Boost filesystem API version 3, + // which is the default starting with Boost 1.46, + // the filename() method returns a path object. + // + // To get a string from the path object, + // the native() method must be called. + // hypergraphDir = nbestPath.parent_path().filename() + //#if BOOST_VERSION >= 104600 + // .native() + //#endif + //; + + // Hopefully the following compiles under all versions of Boost. + // + // If this line gives you compile errors, + // contact Lane Schwartz on the Moses mailing list + hypergraphDir = nbestPath.parent_path().string(); + } else { stringstream hypergraphDirName; hypergraphDirName << boost::filesystem::current_path() << "/hypergraph"; |