* Create a new feature set of the specified type and read in * the features from File. The correct text representation * for a feature set is an integer which specifies the number (N) * of features in a set followed by a list of N feature * descriptions. * @param File open text file to read new feature set from * @param FeatureDesc specifies type of feature to read from File * @return New
| 162 | * @note History: Wed May 23 09:17:31 1990, DSJ, Created. |
| 163 | */ |
| 164 | FEATURE_SET ReadFeatureSet(FILE* File, const FEATURE_DESC_STRUCT* FeatureDesc) { |
| 165 | FEATURE_SET FeatureSet; |
| 166 | int NumFeatures; |
| 167 | int i; |
| 168 | |
| 169 | if (tfscanf(File, "%d", &NumFeatures) != 1 || NumFeatures < 0) |
| 170 | DoError(ILLEGAL_NUM_FEATURES, "Illegal number of features in set"); |
| 171 | |
| 172 | FeatureSet = NewFeatureSet(NumFeatures); |
| 173 | for (i = 0; i < NumFeatures; i++) |
| 174 | AddFeature(FeatureSet, ReadFeature (File, FeatureDesc)); |
| 175 | |
| 176 | return (FeatureSet); |
| 177 | } /* ReadFeatureSet */ |
| 178 | |
| 179 | /** |
| 180 | * Appends a textual representation of Feature to str. |
no test coverage detected