/** * Translate between a feature name and a feature index. * * @param featureName * a valid feature name * @return a feature index, as could be used to access a feature value in a FeatureVector. * @throws IllegalArgumentException * if the feature name is unknown. */ public int getFeatureIndex(String featureName) { return featureNames.get(featureName); }
/** * Translate between a feature index and a feature name. * * @param index * a feature index, as could be used to access a feature value in a FeatureVector. * @return the name of the feature corresponding to the index * @throws IndexOutOfBoundsException * if index<0 or index>getNumberOfFeatures() */ public String getFeatureName(int index) { return featureNames.get(index); }
/** * Translate between a feature name and a feature index. * * @param featureName * a valid feature name * @return a feature index, as could be used to access a feature value in a FeatureVector. * @throws IllegalArgumentException * if the feature name is unknown. */ public int getFeatureIndex(String featureName) { return featureNames.get(featureName); }
/** * Translate between a feature index and a feature name. * * @param index * a feature index, as could be used to access a feature value in a FeatureVector. * @return the name of the feature corresponding to the index * @throws IndexOutOfBoundsException * if index<0 or index>getNumberOfFeatures() */ public String getFeatureName(int index) { return featureNames.get(index); }
/** * List all feature names, separated by white space, in their order of definition. * * @return buf converted into a string */ public String getFeatureNames() { StringBuilder buf = new StringBuilder(); for (int i = 0, n = getNumberOfFeatures(); i < n; i++) { if (buf.length() > 0) buf.append(" "); buf.append(featureNames.get(i)); } return buf.toString(); }
/** * List all feature names, separated by white space, in their order of definition. * * @return buf converted into a string */ public String getFeatureNames() { StringBuilder buf = new StringBuilder(); for (int i = 0, n = getNumberOfFeatures(); i < n; i++) { if (buf.length() > 0) buf.append(" "); buf.append(featureNames.get(i)); } return buf.toString(); }
/** * Translate between a feature index and a feature name. * * @param index * a feature index, as could be used to access a feature value in a FeatureVector. * @return the name of the feature corresponding to the index * @throws IndexOutOfBoundsException * if index<0 or index>getNumberOfFeatures() */ public String getFeatureName(int index) { return featureNames.get(index); }
/** * Translate between a feature name and a feature index. * * @param featureName * a valid feature name * @return a feature index, as could be used to access a feature value in a FeatureVector. * @throws IllegalArgumentException * if the feature name is unknown. */ public int getFeatureIndex(String featureName) { return featureNames.get(featureName); }
/** * List all feature names, separated by white space, in their order of definition. * * @return buf converted into a string */ public String getFeatureNames() { StringBuilder buf = new StringBuilder(); for (int i = 0, n = getNumberOfFeatures(); i < n; i++) { if (buf.length() > 0) buf.append(" "); buf.append(featureNames.get(i)); } return buf.toString(); }