public List <int> MapFeatures(string[] features) { var posFeatureIds = new List <int>(); foreach (var feature in features) { if (FeatureMap.ContainsKey(feature)) { posFeatureIds.Add(FeatureMap[feature]); } else { FeatureMap.Add(feature, EntryCount); posFeatureIds.Add(EntryCount); EntryCount++; } } return(posFeatureIds); }