src/classify/featdefs.cpp
CHAR_DESC_STRUCT *ReadCharDescription(const FEATURE_DEFS_STRUCT &FeatureDefs, FILE *File) {
  int NumSetsToRead;
  char ShortName[FEAT_NAME_SIZE];
  int Type;

  ASSERT_HOST(tfscanf(File, "%d", &NumSetsToRead) == 1);
  ASSERT_HOST(NumSetsToRead >= 0);
  ASSERT_HOST(NumSetsToRead <= FeatureDefs.NumFeatureTypes);

  auto CharDesc = new CHAR_DESC_STRUCT(FeatureDefs);
  for (; NumSetsToRead > 0; NumSetsToRead--) {
    tfscanf(File, "%s", ShortName);
    Type = ShortNameToFeatureType(FeatureDefs, ShortName);
    CharDesc->FeatureSets[Type] = ReadFeatureSet(File, FeatureDefs.FeatureDesc[Type]);
  }
  return CharDesc;
}
/*---------------------------------------------------------------------------*/
/**
 * Read a character description from File, and return
 * a data structure containing this information.  The data
 * is formatted as follows:
 * @verbatim
     NumberOfSets
             ShortNameForSet1 Set1
             ShortNameForSet2 Set2
             ...
   @endverbatim
 *
 * Globals:
 * - none
 *
 * @param FeatureDefs    definitions of feature types/extractors
 * @param File open text file to read character description from
 * @return Character description read from File.
 */
Read a character description from File, and return
a data structure containing this information.  The data
is formatted as follows:
@verbatim
NumberOfSets
ShortNameForSet1 Set1
ShortNameForSet2 Set2

@endverbatim

- none

@param FeatureDefs    definitions of feature types/extractors
@param File open text file to read character description from
@return Character description read from File.
Read a character description from File and return a data structure containing this information . The data is formatted as follows : @verbatim NumberOfSets ShortNameForSet1 Set1 ShortNameForSet2 Set2 @endverbatim - none @param FeatureDefs definitions of feature types / extractors @param File open text file to read character description from @return Character description read from File .
CHAR_DESC_STRUCT *ReadCharDescription(const FEATURE_DEFS_STRUCT &FeatureDefs, FILE *File) {
  int NumSetsToRead;
  char ShortName[FEAT_NAME_SIZE];
  int Type;
  ASSERT_HOST(tfscanf(File, "%d", &NumSetsToRead) == 1);
  ASSERT_HOST(NumSetsToRead >= 0);
  ASSERT_HOST(NumSetsToRead <= FeatureDefs.NumFeatureTypes);
  auto CharDesc = new CHAR_DESC_STRUCT(FeatureDefs);
  for (; NumSetsToRead > 0; NumSetsToRead--) {
    tfscanf(File, "%s", ShortName);
    Type = ShortNameToFeatureType(FeatureDefs, ShortName);
    CharDesc->FeatureSets[Type] = ReadFeatureSet(File, FeatureDefs.FeatureDesc[Type]);
  }
  return CharDesc;
}
CHAR_DESC_STRUCT * ReadCharDescription ( const FEATURE_DEFS_STRUCT & FeatureDefs , FILE * File ) { int NumSetsToRead ; char ShortName [ FEAT_NAME_SIZE ] ; int Type ; ASSERT_HOST ( tfscanf ( File , " " , & NumSetsToRead ) == 1 ) ; ASSERT_HOST ( NumSetsToRead >= 0 ) ; ASSERT_HOST ( NumSetsToRead <= FeatureDefs . NumFeatureTypes ) ; auto CharDesc = new CHAR_DESC_STRUCT ( FeatureDefs ) ; for ( ; NumSetsToRead > 0 ; NumSetsToRead -- ) { tfscanf ( File , " " , ShortName ) ; Type = ShortNameToFeatureType ( FeatureDefs , ShortName ) ; CharDesc -> FeatureSets [ Type ] = ReadFeatureSet ( File , FeatureDefs . FeatureDesc [ Type ] ) ; } return CharDesc ; }
Read a character description from File, and return
 a data structure containing this information.
Read a character description from File and return a data structure containing this information .