public static <T, U> DictionaryFeatureVectorGenerator<T, U> createFromData(Collection<T> data,
      FeatureGenerator<T, U> generator, boolean ignoreOovFeatures) {
    IndexedList<U> features = new IndexedList<U>();
    for (T datum : data) {
      features.addAll(generator.generateFeatures(datum).keySet());
    }
    return new DictionaryFeatureVectorGenerator<T, U>(features, generator, ignoreOovFeatures);
  }
public static < T , U > DictionaryFeatureVectorGenerator < T , U > createFromData ( Collection < T > data , FeatureGenerator < T , U > generator , boolean ignoreOovFeatures ) { IndexedList < U > features = new IndexedList < U > ( ) ; for ( T datum : data ) { features . addAll ( generator . generateFeatures ( datum ) . keySet ( ) ) ; } return new DictionaryFeatureVectorGenerator < T , U > ( features , generator , ignoreOovFeatures ) ; }
Creates a {@code DictionaryFeatureVectorGenerator} which contains
every feature generated by running {@code generator} on
{@code data}. A common use of this method is to initialize a
fixed vocabulary of features from a training data set.

@param data
@param generator
@param ignoreOovFeatures
@return