public TargetFeatureComputer(FeatureProcessorManager manager,String featureProcessorNames){
  List<MaryFeatureProcessor> byteValuedFeatureProcessors=new ArrayList<MaryFeatureProcessor>();
  List<MaryFeatureProcessor> shortValuedFeatureProcessors=new ArrayList<MaryFeatureProcessor>();
  List<MaryFeatureProcessor> continuousValuedFeatureProcessors=new ArrayList<MaryFeatureProcessor>();
  StringTokenizer st=new StringTokenizer(featureProcessorNames);
  while (st.hasMoreTokens()) {
    String name=st.nextToken();
    MaryFeatureProcessor fp=manager.getFeatureProcessor(name);
    if (fp == null) {
      throw new IllegalArgumentException("Unknown feature processor: " + name);
    }
 else     if (fp instanceof ByteValuedFeatureProcessor) {
      byteValuedFeatureProcessors.add(fp);
    }
 else     if (fp instanceof ShortValuedFeatureProcessor) {
      shortValuedFeatureProcessors.add(fp);
    }
 else     if (fp instanceof ContinuousFeatureProcessor) {
      continuousValuedFeatureProcessors.add(fp);
    }
 else {
      throw new IllegalArgumentException("Unknown feature processor type " + fp.getClass() + " for feature processor: "+ name);
    }
  }
  this.byteValuedDiscreteFeatureProcessors=byteValuedFeatureProcessors.toArray(new ByteValuedFeatureProcessor[0]);
  this.shortValuedDiscreteFeatureProcessors=shortValuedFeatureProcessors.toArray(new ShortValuedFeatureProcessor[0]);
  this.continuousFeatureProcessors=continuousValuedFeatureProcessors.toArray(new ContinuousFeatureProcessor[0]);
}

public TargetFeatureComputer ( FeatureProcessorManager manager , String featureProcessorNames ) { List < MaryFeatureProcessor > byteValuedFeatureProcessors = new ArrayList < MaryFeatureProcessor > ( ) ; List < MaryFeatureProcessor > shortValuedFeatureProcessors = new ArrayList < MaryFeatureProcessor > ( ) ; List < MaryFeatureProcessor > continuousValuedFeatureProcessors = new ArrayList < MaryFeatureProcessor > ( ) ; StringTokenizer st = new StringTokenizer ( featureProcessorNames ) ; while ( st . hasMoreTokens ( ) ) { String name = st . nextToken ( ) ; MaryFeatureProcessor fp = manager . getFeatureProcessor ( name ) ; if ( fp == null ) { throw new IllegalArgumentException ( "Unknown feature processor: " + name ) ; } else if ( fp instanceof ByteValuedFeatureProcessor ) { byteValuedFeatureProcessors . add ( fp ) ; } else if ( fp instanceof ShortValuedFeatureProcessor ) { shortValuedFeatureProcessors . add ( fp ) ; } else if ( fp instanceof ContinuousFeatureProcessor ) { continuousValuedFeatureProcessors . add ( fp ) ; } else { throw new IllegalArgumentException ( "Unknown feature processor type " + fp . getClass ( ) + " for feature processor: " + name ) ; } } this . byteValuedDiscreteFeatureProcessors = byteValuedFeatureProcessors . toArray ( new ByteValuedFeatureProcessor [ 0 ] ) ; this . shortValuedDiscreteFeatureProcessors = shortValuedFeatureProcessors . toArray ( new ShortValuedFeatureProcessor [ 0 ] ) ; this . continuousFeatureProcessors = continuousValuedFeatureProcessors . toArray ( new ContinuousFeatureProcessor [ 0 ] ) ; }
construct a targetfeaturecomputer that knows how to compute features for a target using the given set of feature processor names . these names must be known to the given feature processor manager .
