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/PhrasePairFeature.h"
#include "moses/FF/WordPenaltyProducer.h"
#include "moses/LM/Base.h"
using namespace Mira;
using namespace std;

View File

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

View File

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

View File

@ -9,6 +9,9 @@
#include "moses/StaticData.h"
#include "moses/TranslationOption.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 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/ThreadPool.h"
#include "moses/OutputCollector.h"
#include "moses/TranslationModel/PhraseDictionary.h"
#include "moses/FF/StatefulFeatureFunction.h"
#include "moses/FF/StatelessFeatureFunction.h"
#ifdef HAVE_PROTOBUF
#include "hypergraph.pb.h"

View File

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

View File

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

View File

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

View File

@ -25,7 +25,9 @@
#include "StaticData.h"
#include "TreeInput.h"
#include "Sentence.h"
#include "DecodeGraph.h"
#include "moses/FF/UnknownWordPenaltyProducer.h"
#include "moses/TranslationModel/PhraseDictionary.h"
using namespace std;
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 "GenerationDictionary.h"
#include "StaticData.h"
#include "moses/TranslationModel/PhraseDictionary.h"
namespace Moses
{

View File

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

View File

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

View File

@ -8,6 +8,7 @@
#include "moses/ScoreComponentCollection.h"
#include "moses/TranslationOption.h"
#include "moses/UserMessage.h"
#include "moses/InputPath.h"
#include "util/string_piece_hash.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 "Manager.h"
#include "moses/FF/FFState.h"
#include "moses/FF/StatefulFeatureFunction.h"
#include "moses/FF/StatelessFeatureFunction.h"
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 "Timer.h"
#include "moses/FF/DistortionScoreProducer.h"
#include "moses/LM/Base.h"
#include "moses/TranslationModel/PhraseDictionary.h"
#ifdef HAVE_PROTOBUF
#include "hypergraph.pb.h"

View File

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

View File

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

View File

@ -22,7 +22,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
#include <iostream>
#include "SentenceStats.h"
#include "moses/TranslationOption.h"
#include "InputPath.h"
#include "TranslationOption.h"
using std::cout;
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()
{
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
#include "TypeDef.h"
#include "FactorCollection.h"
#include "Parameter.h"
#include "LM/Base.h"
#include "SentenceStats.h"
#include "DecodeGraph.h"
#include "TranslationOptionList.h"
#include "ScoreComponentCollection.h"
#include "moses/TranslationModel/PhraseDictionary.h"
namespace Moses
{
@ -54,6 +49,7 @@ namespace Moses
class InputType;
class PhraseDictionary;
class GenerationDictionary;
class DecodeGraph;
class DecodeStep;
class WordPenaltyProducer;
class UnknownWordPenaltyProducer;
@ -727,10 +723,6 @@ public:
const PhraseDictionary*GetTranslationScoreProducer(size_t index) const {
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 {
return m_decodeGraphs;
@ -754,6 +746,9 @@ public:
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();
bool GetUseLegacyPT() const
{ 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 "AlignmentInfoCollection.h"
#include "InputPath.h"
#include "moses/TranslationModel/PhraseDictionary.h"
using namespace std;

View File

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

View File

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

View File

@ -4,6 +4,7 @@
#include "StaticData.h"
#include "Util.h"
#include "XmlOption.h"
#include "FactorCollection.h"
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 "TypeDef.h"
#include "FactorTypeSet.h"
#include "FactorCollection.h"
#include "StaticData.h" // needed to determine the FactorDelimiter
#include "util/exception.hh"
#include "util/tokenize_piece.hh"

View File

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