* Create a new feature of the specified type and read in * the value of its parameters from File. The extra penalty * for the feature is also computed by calling the appropriate * function for the specified feature type. The correct text * representation for a feature is a list of N floats where * N is the number of parameters in the feature. * @param File open text file to read feature fr
| 136 | * @note History: Wed May 23 08:53:16 1990, DSJ, Created. |
| 137 | */ |
| 138 | FEATURE ReadFeature(FILE* File, const FEATURE_DESC_STRUCT* FeatureDesc) { |
| 139 | FEATURE Feature; |
| 140 | int i; |
| 141 | |
| 142 | Feature = NewFeature (FeatureDesc); |
| 143 | for (i = 0; i < Feature->Type->NumParams; i++) { |
| 144 | if (tfscanf(File, "%f", &(Feature->Params[i])) != 1) |
| 145 | DoError (ILLEGAL_FEATURE_PARAM, "Illegal feature parameter spec"); |
| 146 | #ifndef _WIN32 |
| 147 | assert (!isnan(Feature->Params[i])); |
| 148 | #endif |
| 149 | } |
| 150 | return (Feature); |
| 151 | } /* ReadFeature */ |
| 152 | |
| 153 | /** |
| 154 | * Create a new feature set of the specified type and read in |
no test coverage detected