00001 
00002 #include <string>
00003 
00004 #include "VWFeatureBase.h"
00005 #include "VWFeatureContext.h"
00006 
00007 namespace Moses
00008 {
00009 std::map<std::string, std::vector<VWFeatureBase*> > VWFeatureBase::s_features;
00010 std::map<std::string, std::vector<VWFeatureBase*> > VWFeatureBase::s_sourceFeatures;
00011 std::map<std::string, std::vector<VWFeatureBase*> > VWFeatureBase::s_targetContextFeatures;
00012 std::map<std::string, std::vector<VWFeatureBase*> > VWFeatureBase::s_targetFeatures;
00013 
00014 std::map<std::string, size_t> VWFeatureBase::s_targetContextLength;
00015 
00016 
00017 void VWFeatureBase::UpdateContextSize(const std::string &usedBy)
00018 {
00019   
00020   
00021   size_t currentSize = s_targetContextLength[usedBy];
00022   size_t newSize = static_cast<VWFeatureContext *const>(this)->GetContextSize();
00023   s_targetContextLength[usedBy] = std::max(currentSize, newSize);
00024 }
00025 
00026 }
00027