#include #include "VWFeatureBase.h" #include "VWFeatureContext.h" namespace Moses { std::map > VWFeatureBase::s_features; std::map > VWFeatureBase::s_sourceFeatures; std::map > VWFeatureBase::s_targetContextFeatures; std::map > VWFeatureBase::s_targetFeatures; std::map VWFeatureBase::s_targetContextLength; void VWFeatureBase::UpdateContextSize(const std::string &usedBy) { // using the standard map behavior here: if the entry does not // exist, it will be added and initialized to zero size_t currentSize = s_targetContextLength[usedBy]; size_t newSize = static_cast(this)->GetContextSize(); s_targetContextLength[usedBy] = std::max(currentSize, newSize); } }