public String toFeatureString(FeatureVector fv){
  if (numByteFeatures != fv.getNumberOfByteFeatures() || numShortFeatures != fv.getNumberOfShortFeatures() || numContinuousFeatures != fv.getNumberOfContinuousFeatures())   throw new IllegalArgumentException("Feature vector '" + fv + "' is inconsistent with feature definition");
  StringBuilder buf=new StringBuilder();
  for (int i=0; i < numByteFeatures; i++) {
    if (buf.length() > 0)     buf.append(" ");
    buf.append(getFeatureValueAsString(i,fv.getByteFeature(i)));
  }
  for (int i=numByteFeatures; i < numByteFeatures + numShortFeatures; i++) {
    if (buf.length() > 0)     buf.append(" ");
    buf.append(getFeatureValueAsString(i,fv.getShortFeature(i)));
  }
  for (int i=numByteFeatures + numShortFeatures; i < numByteFeatures + numShortFeatures + numContinuousFeatures; i++) {
    if (buf.length() > 0)     buf.append(" ");
    buf.append(fv.getContinuousFeature(i));
  }
  return buf.toString();
}

public String toFeatureString ( FeatureVector fv ) { if ( numByteFeatures != fv . getNumberOfByteFeatures ( ) || numShortFeatures != fv . getNumberOfShortFeatures ( ) || numContinuousFeatures != fv . getNumberOfContinuousFeatures ( ) ) throw new IllegalArgumentException ( "Feature vector '" + fv + "' is inconsistent with feature definition" ) ; StringBuilder buf = new StringBuilder ( ) ; for ( int i = 0 ; i < numByteFeatures ; i ++ ) { if ( buf . length ( ) > 0 ) buf . append ( " " ) ; buf . append ( getFeatureValueAsString ( i , fv . getByteFeature ( i ) ) ) ; } for ( int i = numByteFeatures ; i < numByteFeatures + numShortFeatures ; i ++ ) { if ( buf . length ( ) > 0 ) buf . append ( " " ) ; buf . append ( getFeatureValueAsString ( i , fv . getShortFeature ( i ) ) ) ; } for ( int i = numByteFeatures + numShortFeatures ; i < numByteFeatures + numShortFeatures + numContinuousFeatures ; i ++ ) { if ( buf . length ( ) > 0 ) buf . append ( " " ) ; buf . append ( fv . getContinuousFeature ( i ) ) ; } return buf . toString ( ) ; }
convert a feature vector into a string representation .
