@Override
  protected FeatureSample processSample(FeatureSample reference) {
    String[] predictedFeatures = featurizer.featurize(reference.getSentence(),
        reference.getTags());
    String[] referenceTags = reference.getFeatures();

    for (int i = 0; i < referenceTags.length; i++) {
      if (referenceTags[i].equals(predictedFeatures[i])) {
        wordAccuracy.add(1);
      } else {
        wordAccuracy.add(0);
      }
    }

    FeatureSample result = new FeatureSample(reference.getSentence(), reference.getLemmas(),
        reference.getTags(), predictedFeatures);

    return result;
  }
@ Override protected FeatureSample processSample ( FeatureSample reference ) { String [ ] predictedFeatures = featurizer . featurize ( reference . getSentence ( ) , reference . getTags ( ) ) ; String [ ] referenceTags = reference . getFeatures ( ) ; for ( int i = 0 ; i < referenceTags . length ; i ++ ) { if ( referenceTags [ i ] . equals ( predictedFeatures [ i ] ) ) { wordAccuracy . add ( 1 ) ; } else { wordAccuracy . add ( 0 ) ; } } FeatureSample result = new FeatureSample ( reference . getSentence ( ) , reference . getLemmas ( ) , reference . getTags ( ) , predictedFeatures ) ; return result ; }
Evaluates the given reference {@link FeatureSample} object.

This is done by finding the phrases with the {@link Featurizer} in the
sentence from the reference {@link FeatureSample}. The found phrases are
then used to calculate and update the scores.

@param reference
the reference {@link FeatureSample}.

@return the predicted sample