Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'moses/src/StaticData.cpp')
-rw-r--r--moses/src/StaticData.cpp27
1 files changed, 16 insertions, 11 deletions
diff --git a/moses/src/StaticData.cpp b/moses/src/StaticData.cpp
index 39c47178a..36e8757c7 100644
--- a/moses/src/StaticData.cpp
+++ b/moses/src/StaticData.cpp
@@ -20,9 +20,6 @@ License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
***********************************************************************/
-#include <boost/filesystem/operations.hpp>
-#include <boost/filesystem/path.hpp>
-
#include <string>
#include "util/check.hh"
#include "PhraseDictionaryMemory.h"
@@ -2095,16 +2092,24 @@ void StaticData::ReLoadBleuScoreFeatureParameter(float weight)
void StaticData::SetExecPath(const std::string &path)
{
- namespace fs = boost::filesystem;
-
- fs::path full_path( fs::initial_path<fs::path>() );
+ /*
+ namespace fs = boost::filesystem;
+
+ fs::path full_path( fs::initial_path<fs::path>() );
+
+ full_path = fs::system_complete( fs::path( path ) );
+
+ //Without file name
+ m_binPath = full_path.parent_path().string();
+ */
- full_path = fs::system_complete( fs::path( path ) );
-
- //Without file name
- m_binPath = full_path.parent_path().string();
+ // NOT TESTED
+ size_t pos = path.rfind("/");
+ if (pos != string::npos)
+ {
+ m_binPath = path.substr(0, pos);
+ }
cerr << m_binPath << endl;
-
}
const string &StaticData::GetBinDirectory() const