speed up compiling by removing headers from StaticData.h

This commit is contained in:
Hieu Hoang 2013-10-03 11:05:53 +01:00
parent f2d218f8ee
commit 6ccc17b804
26 changed files with 43 additions and 18 deletions

View File

@ -47,6 +47,7 @@ namespace mpi = boost::mpi;
#include "moses/FF/WordTranslationFeature.h" #include "moses/FF/WordTranslationFeature.h"
#include "moses/FF/PhrasePairFeature.h" #include "moses/FF/PhrasePairFeature.h"
#include "moses/FF/WordPenaltyProducer.h" #include "moses/FF/WordPenaltyProducer.h"
#include "moses/LM/Base.h"
using namespace Mira; using namespace Mira;
using namespace std; using namespace std;

View File

@ -33,6 +33,7 @@ POSSIBILITY OF SUCH DAMAGE.
// example file on how to use moses library // example file on how to use moses library
#include <iostream> #include <iostream>
#include <boost/algorithm/string.hpp>
#include "IOWrapper.h" #include "IOWrapper.h"
#include "moses/TypeDef.h" #include "moses/TypeDef.h"
#include "moses/Util.h" #include "moses/Util.h"
@ -47,9 +48,8 @@ POSSIBILITY OF SUCH DAMAGE.
#include "moses/ChartTranslationOptions.h" #include "moses/ChartTranslationOptions.h"
#include "moses/ChartHypothesis.h" #include "moses/ChartHypothesis.h"
#include "moses/FeatureVector.h" #include "moses/FeatureVector.h"
#include "moses/FF/StatefulFeatureFunction.h"
#include <boost/algorithm/string.hpp> #include "moses/FF/StatelessFeatureFunction.h"
using namespace std; using namespace std;
using namespace Moses; using namespace Moses;

View File

@ -59,6 +59,8 @@ POSSIBILITY OF SUCH DAMAGE.
#include "moses/ChartTrellisPath.h" #include "moses/ChartTrellisPath.h"
#include "moses/ChartTrellisPathList.h" #include "moses/ChartTrellisPathList.h"
#include "moses/Incremental.h" #include "moses/Incremental.h"
#include "moses/FF/StatefulFeatureFunction.h"
#include "moses/FF/StatelessFeatureFunction.h"
#include "util/usage.hh" #include "util/usage.hh"

View File

@ -9,6 +9,9 @@
#include "moses/StaticData.h" #include "moses/StaticData.h"
#include "moses/TranslationOption.h" #include "moses/TranslationOption.h"
#include "moses/DecodeStepTranslation.h" #include "moses/DecodeStepTranslation.h"
#include "moses/FF/StatefulFeatureFunction.h"
#include "moses/FF/StatelessFeatureFunction.h"
#include "moses/LM/Base.h"
using namespace std; using namespace std;
using namespace Moses; using namespace Moses;

View File

@ -53,6 +53,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#include "moses/Timer.h" #include "moses/Timer.h"
#include "moses/ThreadPool.h" #include "moses/ThreadPool.h"
#include "moses/OutputCollector.h" #include "moses/OutputCollector.h"
#include "moses/TranslationModel/PhraseDictionary.h"
#include "moses/FF/StatefulFeatureFunction.h"
#include "moses/FF/StatelessFeatureFunction.h"
#ifdef HAVE_PROTOBUF #ifdef HAVE_PROTOBUF
#include "hypergraph.pb.h" #include "hypergraph.pb.h"

View File

@ -6,6 +6,9 @@
#include "moses/StaticData.h" #include "moses/StaticData.h"
#include "moses/Hypothesis.h" #include "moses/Hypothesis.h"
#include "TranslationAnalysis.h" #include "TranslationAnalysis.h"
#include "moses/FF/StatefulFeatureFunction.h"
#include "moses/FF/StatelessFeatureFunction.h"
#include "moses/LM/Base.h"
using namespace Moses; using namespace Moses;

View File

@ -42,6 +42,7 @@ class Hypothesis;
class HypothesisStackCubePruning; class HypothesisStackCubePruning;
class HypothesisQueueItem; class HypothesisQueueItem;
class QueueItemOrderer; class QueueItemOrderer;
class TranslationOptionList;
typedef std::vector< Hypothesis* > HypothesisSet; typedef std::vector< Hypothesis* > HypothesisSet;
typedef std::set< BackwardsEdge* > BackwardsEdgeSet; typedef std::set< BackwardsEdge* > BackwardsEdgeSet;

View File

@ -29,6 +29,8 @@
#include "StaticData.h" #include "StaticData.h"
#include "ChartTranslationOptions.h" #include "ChartTranslationOptions.h"
#include "moses/FF/FFState.h" #include "moses/FF/FFState.h"
#include "moses/FF/StatefulFeatureFunction.h"
#include "moses/FF/StatelessFeatureFunction.h"
using namespace std; using namespace std;

View File

@ -25,7 +25,9 @@
#include "StaticData.h" #include "StaticData.h"
#include "TreeInput.h" #include "TreeInput.h"
#include "Sentence.h" #include "Sentence.h"
#include "DecodeGraph.h"
#include "moses/FF/UnknownWordPenaltyProducer.h" #include "moses/FF/UnknownWordPenaltyProducer.h"
#include "moses/TranslationModel/PhraseDictionary.h"
using namespace std; using namespace std;
using namespace Moses; using namespace Moses;

View File

@ -22,6 +22,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#include "DecodeStep.h" #include "DecodeStep.h"
#include "GenerationDictionary.h" #include "GenerationDictionary.h"
#include "StaticData.h" #include "StaticData.h"
#include "moses/TranslationModel/PhraseDictionary.h"
namespace Moses namespace Moses
{ {

View File

@ -2,6 +2,7 @@
#include "moses/Hypothesis.h" #include "moses/Hypothesis.h"
#include "moses/TranslationOption.h" #include "moses/TranslationOption.h"
#include "moses/InputPath.h"
using namespace std; using namespace std;

View File

@ -5,6 +5,7 @@
#include "moses/TargetPhrase.h" #include "moses/TargetPhrase.h"
#include "moses/Hypothesis.h" #include "moses/Hypothesis.h"
#include "moses/TranslationOption.h" #include "moses/TranslationOption.h"
#include "moses/InputPath.h"
#include "util/string_piece_hash.hh" #include "util/string_piece_hash.hh"
#include "util/exception.hh" #include "util/exception.hh"

View File

@ -8,6 +8,7 @@
#include "moses/ScoreComponentCollection.h" #include "moses/ScoreComponentCollection.h"
#include "moses/TranslationOption.h" #include "moses/TranslationOption.h"
#include "moses/UserMessage.h" #include "moses/UserMessage.h"
#include "moses/InputPath.h"
#include "util/string_piece_hash.hh" #include "util/string_piece_hash.hh"
#include "util/exception.hh" #include "util/exception.hh"

View File

@ -34,6 +34,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#include "InputType.h" #include "InputType.h"
#include "Manager.h" #include "Manager.h"
#include "moses/FF/FFState.h" #include "moses/FF/FFState.h"
#include "moses/FF/StatefulFeatureFunction.h"
#include "moses/FF/StatelessFeatureFunction.h"
using namespace std; using namespace std;

View File

@ -40,6 +40,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#include "TranslationOptionCollection.h" #include "TranslationOptionCollection.h"
#include "Timer.h" #include "Timer.h"
#include "moses/FF/DistortionScoreProducer.h" #include "moses/FF/DistortionScoreProducer.h"
#include "moses/LM/Base.h"
#include "moses/TranslationModel/PhraseDictionary.h"
#ifdef HAVE_PROTOBUF #ifdef HAVE_PROTOBUF
#include "hypergraph.pb.h" #include "hypergraph.pb.h"

View File

@ -5,6 +5,7 @@
#include "TypeDef.h" #include "TypeDef.h"
#include "TranslationOption.h" #include "TranslationOption.h"
#include "Phrase.h" #include "Phrase.h"
#include "InputPath.h"
namespace Moses namespace Moses
{ {

View File

@ -21,6 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
***********************************************************************/ ***********************************************************************/
#include <stdexcept> #include <stdexcept>
#include <boost/algorithm/string.hpp>
#include "Sentence.h" #include "Sentence.h"
#include "TranslationOptionCollectionText.h" #include "TranslationOptionCollectionText.h"
@ -28,7 +29,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#include "ChartTranslationOptions.h" #include "ChartTranslationOptions.h"
#include "Util.h" #include "Util.h"
#include "XmlOption.h" #include "XmlOption.h"
#include <boost/algorithm/string.hpp> #include "FactorCollection.h"
using namespace std; using namespace std;

View File

@ -22,7 +22,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#include <iostream> #include <iostream>
#include "SentenceStats.h" #include "SentenceStats.h"
#include "moses/TranslationOption.h" #include "InputPath.h"
#include "TranslationOption.h"
using std::cout; using std::cout;
using std::endl; using std::endl;

View File

@ -1067,8 +1067,6 @@ void StaticData::OverrideFeatures()
} }
// check whether we should be using the old code to support binary phrase-table.
// eventually, we'll stop support the binary phrase-table and delete this legacy code
void StaticData::CheckLEGACYPT() void StaticData::CheckLEGACYPT()
{ {
for (size_t i = 0; i < m_phraseDictionary.size(); ++i) { for (size_t i = 0; i < m_phraseDictionary.size(); ++i) {

View File

@ -39,14 +39,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#endif #endif
#include "TypeDef.h" #include "TypeDef.h"
#include "FactorCollection.h"
#include "Parameter.h" #include "Parameter.h"
#include "LM/Base.h"
#include "SentenceStats.h" #include "SentenceStats.h"
#include "DecodeGraph.h"
#include "TranslationOptionList.h"
#include "ScoreComponentCollection.h" #include "ScoreComponentCollection.h"
#include "moses/TranslationModel/PhraseDictionary.h"
namespace Moses namespace Moses
{ {
@ -54,6 +49,7 @@ namespace Moses
class InputType; class InputType;
class PhraseDictionary; class PhraseDictionary;
class GenerationDictionary; class GenerationDictionary;
class DecodeGraph;
class DecodeStep; class DecodeStep;
class WordPenaltyProducer; class WordPenaltyProducer;
class UnknownWordPenaltyProducer; class UnknownWordPenaltyProducer;
@ -727,10 +723,6 @@ public:
const PhraseDictionary*GetTranslationScoreProducer(size_t index) const { const PhraseDictionary*GetTranslationScoreProducer(size_t index) const {
return GetPhraseDictionaries().at(index); return GetPhraseDictionaries().at(index);
} }
std::vector<float> GetTranslationWeights(size_t index) const {
std::vector<float> weights = GetWeights(GetTranslationScoreProducer(index));
return weights;
}
const std::vector<DecodeGraph*>& GetDecodeGraphs() const { const std::vector<DecodeGraph*>& GetDecodeGraphs() const {
return m_decodeGraphs; return m_decodeGraphs;
@ -754,6 +746,9 @@ public:
return m_placeHolderFactor; return m_placeHolderFactor;
} }
/** check whether we should be using the old code to support binary phrase-table.
** eventually, we'll stop support the binary phrase-table and delete this legacy code
**/
void CheckLEGACYPT(); void CheckLEGACYPT();
bool GetUseLegacyPT() const bool GetUseLegacyPT() const
{ return m_useLegacyPT; } { return m_useLegacyPT; }

View File

@ -33,6 +33,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#include "Util.h" #include "Util.h"
#include "AlignmentInfoCollection.h" #include "AlignmentInfoCollection.h"
#include "InputPath.h" #include "InputPath.h"
#include "moses/TranslationModel/PhraseDictionary.h"
using namespace std; using namespace std;

View File

@ -4,7 +4,7 @@
#include "TranslationOptionCollectionConfusionNet.h" #include "TranslationOptionCollectionConfusionNet.h"
#include "ConfusionNet.h" #include "ConfusionNet.h"
#include "WordLattice.h" #include "WordLattice.h"
#include "DecodeStep.h" #include "DecodeGraph.h"
#include "DecodeStepTranslation.h" #include "DecodeStepTranslation.h"
#include "DecodeStepGeneration.h" #include "DecodeStepGeneration.h"
#include "FactorCollection.h" #include "FactorCollection.h"

View File

@ -4,7 +4,7 @@
#include "TranslationOptionCollectionLattice.h" #include "TranslationOptionCollectionLattice.h"
#include "ConfusionNet.h" #include "ConfusionNet.h"
#include "WordLattice.h" #include "WordLattice.h"
#include "DecodeStep.h" #include "DecodeGraph.h"
#include "DecodeStepTranslation.h" #include "DecodeStepTranslation.h"
#include "DecodeStepGeneration.h" #include "DecodeStepGeneration.h"
#include "FactorCollection.h" #include "FactorCollection.h"

View File

@ -4,6 +4,7 @@
#include "StaticData.h" #include "StaticData.h"
#include "Util.h" #include "Util.h"
#include "XmlOption.h" #include "XmlOption.h"
#include "FactorCollection.h"
using namespace std; using namespace std;

View File

@ -25,6 +25,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#include "Word.h" #include "Word.h"
#include "TypeDef.h" #include "TypeDef.h"
#include "FactorTypeSet.h" #include "FactorTypeSet.h"
#include "FactorCollection.h"
#include "StaticData.h" // needed to determine the FactorDelimiter #include "StaticData.h" // needed to determine the FactorDelimiter
#include "util/exception.hh" #include "util/exception.hh"
#include "util/tokenize_piece.hh" #include "util/tokenize_piece.hh"

View File

@ -29,6 +29,7 @@
#include "WordsRange.h" #include "WordsRange.h"
#include "TargetPhrase.h" #include "TargetPhrase.h"
#include "ReorderingConstraint.h" #include "ReorderingConstraint.h"
#include "FactorCollection.h"
namespace Moses namespace Moses
{ {