diff --git a/contrib/other-builds/moses/.cproject b/contrib/other-builds/moses/.cproject index ed1c9ef39..669c64704 100644 --- a/contrib/other-builds/moses/.cproject +++ b/contrib/other-builds/moses/.cproject @@ -1,7 +1,5 @@ - - - + @@ -13,12 +11,12 @@ - - + + @@ -77,8 +75,9 @@ - + + @@ -127,16 +126,23 @@ + - - + + + + + + - + + + - + @@ -146,13 +152,13 @@ - - + + @@ -198,12 +204,12 @@ - - + + @@ -268,8 +274,8 @@ - + diff --git a/phrase-extract/Jamfile b/phrase-extract/Jamfile index 50fed2973..7bf63e587 100644 --- a/phrase-extract/Jamfile +++ b/phrase-extract/Jamfile @@ -4,7 +4,7 @@ for local d in $(most-deps) { obj $(d:B).o : $(d) ; } #and stuff them into an alias. -alias deps : $(most-deps:B).o ..//z ..//boost_iostreams ../moses//ThreadPool ../moses//Util ../util//kenutil ; +alias deps : $(most-deps:B).o ..//z ..//boost_iostreams ../moses//moses ../moses//ThreadPool ../moses//Util ../util//kenutil ; #ExtractionPhrasePair.cpp requires that main define some global variables. #Build the mains that do not need these global variables. diff --git a/phrase-extract/extract-mixed-syntax/Jamfile b/phrase-extract/extract-mixed-syntax/Jamfile index 8072a54b0..520cd65cb 100644 --- a/phrase-extract/extract-mixed-syntax/Jamfile +++ b/phrase-extract/extract-mixed-syntax/Jamfile @@ -1,2 +1,2 @@ -exe extract-mixed-syntax : Main.cpp AlignedSentence.cpp AlignedSentenceSyntax.cpp ConsistentPhrase.cpp ConsistentPhrases.cpp NonTerm.cpp OutputFileStream.cpp Parameter.cpp Phrase.cpp pugixml.cpp Rule.cpp RulePhrase.cpp Rules.cpp RuleSymbol.cpp SyntaxTree.cpp Word.cpp ..//..//z ..//..//boost_iostreams ..//..//boost_program_options ..//..//moses ; +exe extract-mixed-syntax : Main.cpp AlignedSentence.cpp AlignedSentenceSyntax.cpp ConsistentPhrase.cpp ConsistentPhrases.cpp NonTerm.cpp Parameter.cpp Phrase.cpp pugixml.cpp Rule.cpp RulePhrase.cpp Rules.cpp RuleSymbol.cpp SyntaxTree.cpp Word.cpp ..//deps ../..//z ../..//boost_iostreams ../..//boost_program_options ../../moses//moses : .. ; diff --git a/phrase-extract/extract-mixed-syntax/OutputFileStream.cpp b/phrase-extract/extract-mixed-syntax/OutputFileStream.cpp deleted file mode 100644 index a61ce1ab1..000000000 --- a/phrase-extract/extract-mixed-syntax/OutputFileStream.cpp +++ /dev/null @@ -1,79 +0,0 @@ -// $Id: OutputFileStream.cpp 2780 2010-01-29 17:11:17Z bojar $ - -/*********************************************************************** - Moses - factored phrase-based language decoder - Copyright (C) 2006 University of Edinburgh - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - 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 -#include "OutputFileStream.h" -#include "gzfilebuf.h" - -using namespace std; - -namespace Moses -{ -OutputFileStream::OutputFileStream() - :boost::iostreams::filtering_ostream() - ,m_outFile(NULL) -{ -} - -OutputFileStream::OutputFileStream(const std::string &filePath) - : m_outFile(NULL) -{ - Open(filePath); -} - -OutputFileStream::~OutputFileStream() -{ - Close(); -} - -bool OutputFileStream::Open(const std::string &filePath) -{ - m_outFile = new ofstream(filePath.c_str(), ios_base::out | ios_base::binary); - if (m_outFile->fail()) { - return false; - } - - if (filePath.size() > 3 && filePath.substr(filePath.size() - 3, 3) == ".gz") { - this->push(boost::iostreams::gzip_compressor()); - } - this->push(*m_outFile); - - return true; -} - -void OutputFileStream::Close() -{ - if (m_outFile == NULL) { - return; - } - - this->flush(); - this->pop(); // file - - m_outFile->close(); - delete m_outFile; - m_outFile = NULL; - return; -} - - -} - diff --git a/phrase-extract/extract-mixed-syntax/OutputFileStream.h b/phrase-extract/extract-mixed-syntax/OutputFileStream.h deleted file mode 100644 index f52e36d76..000000000 --- a/phrase-extract/extract-mixed-syntax/OutputFileStream.h +++ /dev/null @@ -1,50 +0,0 @@ -// $Id: InputFileStream.h 2939 2010-02-24 11:15:44Z jfouet $ - -/*********************************************************************** - Moses - factored phrase-based language decoder - Copyright (C) 2006 University of Edinburgh - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - ***********************************************************************/ - -#pragma once - -#include -#include -#include -#include -#include - -namespace Moses -{ - -/** Used in place of std::istream, can read zipped files if it ends in .gz - */ -class OutputFileStream : public boost::iostreams::filtering_ostream -{ -protected: - std::ofstream *m_outFile; -public: - OutputFileStream(); - - OutputFileStream(const std::string &filePath); - virtual ~OutputFileStream(); - - bool Open(const std::string &filePath); - void Close(); -}; - -} -