doxygen training/cntraining.cpp

This commit is contained in:
Jim O'Regan 2015-07-20 17:22:25 +01:00
parent aa1df05321
commit cc5f466ac6

View File

@ -21,9 +21,9 @@
******************************************************************************/ ******************************************************************************/
/**---------------------------------------------------------------------------- /*----------------------------------------------------------------------------
Include Files and Type Defines Include Files and Type Defines
----------------------------------------------------------------------------**/ ----------------------------------------------------------------------------*/
#include "oldlist.h" #include "oldlist.h"
#include "efio.h" #include "efio.h"
#include "emalloc.h" #include "emalloc.h"
@ -42,16 +42,16 @@
DECLARE_STRING_PARAM_FLAG(D); DECLARE_STRING_PARAM_FLAG(D);
/**---------------------------------------------------------------------------- /*----------------------------------------------------------------------------
Public Function Prototypes Public Function Prototypes
----------------------------------------------------------------------------**/ ----------------------------------------------------------------------------*/
int main ( int main (
int argc, int argc,
char **argv); char **argv);
/**---------------------------------------------------------------------------- /*----------------------------------------------------------------------------
Private Function Prototypes Private Function Prototypes
----------------------------------------------------------------------------**/ ----------------------------------------------------------------------------*/
void WriteNormProtos ( void WriteNormProtos (
const char *Directory, const char *Directory,
@ -71,9 +71,9 @@ void WriteProtos(
BOOL8 WriteSigProtos, BOOL8 WriteSigProtos,
BOOL8 WriteInsigProtos); BOOL8 WriteInsigProtos);
/**---------------------------------------------------------------------------- /*----------------------------------------------------------------------------
Global Data Definitions and Declarations Global Data Definitions and Declarations
----------------------------------------------------------------------------**/ ----------------------------------------------------------------------------*/
/* global variable to hold configuration parameters to control clustering */ /* global variable to hold configuration parameters to control clustering */
//-M 0.025 -B 0.05 -I 0.8 -C 1e-3 //-M 0.025 -B 0.05 -I 0.8 -C 1e-3
CLUSTERCONFIG CNConfig = CLUSTERCONFIG CNConfig =
@ -82,63 +82,59 @@ CLUSTERCONFIG CNConfig =
}; };
/**---------------------------------------------------------------------------- /*----------------------------------------------------------------------------
Public Code Public Code
----------------------------------------------------------------------------**/ ----------------------------------------------------------------------------*/
/*---------------------------------------------------------------------------*/ /*---------------------------------------------------------------------------*/
int main(int argc, char* argv[]) /**
* This program reads in a text file consisting of feature
/* * samples from a training page in the following format:
** Parameters: * @verbatim
** argc number of command line arguments FontName CharName NumberOfFeatureTypes(N)
** argv array of command line arguments FeatureTypeName1 NumberOfFeatures(M)
** Globals: none Feature1
** Operation: ...
** This program reads in a text file consisting of feature FeatureM
** samples from a training page in the following format: FeatureTypeName2 NumberOfFeatures(M)
** Feature1
** FontName CharName NumberOfFeatureTypes(N) ...
** FeatureTypeName1 NumberOfFeatures(M) FeatureM
** Feature1 ...
** ... FeatureTypeNameN NumberOfFeatures(M)
** FeatureM Feature1
** FeatureTypeName2 NumberOfFeatures(M) ...
** Feature1 FeatureM
** ... FontName CharName ...
** FeatureM @endverbatim
** ... * It then appends these samples into a separate file for each
** FeatureTypeNameN NumberOfFeatures(M) * character. The name of the file is
** Feature1 *
** ... * DirectoryName/FontName/CharName.FeatureTypeName
** FeatureM *
** FontName CharName ... * The DirectoryName can be specified via a command
** * line argument. If not specified, it defaults to the
** It then appends these samples into a separate file for each * current directory. The format of the resulting files is:
** character. The name of the file is * @verbatim
** NumberOfFeatures(M)
** DirectoryName/FontName/CharName.FeatureTypeName Feature1
** ...
** The DirectoryName can be specified via a command FeatureM
** line argument. If not specified, it defaults to the NumberOfFeatures(M)
** current directory. The format of the resulting files is: ...
** @endverbatim
** NumberOfFeatures(M) * The output files each have a header which describes the
** Feature1 * type of feature which the file contains. This header is
** ... * in the format required by the clusterer. A command line
** FeatureM * argument can also be used to specify that only the first
** NumberOfFeatures(M) * N samples of each class should be used.
** ... * @param argc number of command line arguments
** * @param argv array of command line arguments
** The output files each have a header which describes the * @return none
** type of feature which the file contains. This header is * @note Globals: none
** in the format required by the clusterer. A command line * @note Exceptions: none
** argument can also be used to specify that only the first * @note History: Fri Aug 18 08:56:17 1989, DSJ, Created.
** N samples of each class should be used.
** Return: none
** Exceptions: none
** History: Fri Aug 18 08:56:17 1989, DSJ, Created.
*/ */
int main(int argc, char* argv[])
{ {
// Set the global Config parameters before parsing the command line. // Set the global Config parameters before parsing the command line.
Config = CNConfig; Config = CNConfig;
@ -207,28 +203,26 @@ int main(int argc, char* argv[])
} // main } // main
/**---------------------------------------------------------------------------- /*----------------------------------------------------------------------------
Private Code Private Code
----------------------------------------------------------------------------**/ ----------------------------------------------------------------------------*/
/*----------------------------------------------------------------------------*/ /*----------------------------------------------------------------------------*/
/**
* This routine writes the specified samples into files which
* are organized according to the font name and character name
* of the samples.
* @param Directory directory to place sample files into
* @param LabeledProtoList List of labeled protos
* @param Clusterer The CLUSTERER to use
* @return none
* @note Exceptions: none
* @note History: Fri Aug 18 16:17:06 1989, DSJ, Created.
*/
void WriteNormProtos ( void WriteNormProtos (
const char *Directory, const char *Directory,
LIST LabeledProtoList, LIST LabeledProtoList,
CLUSTERER *Clusterer) CLUSTERER *Clusterer)
/*
** Parameters:
** Directory directory to place sample files into
** Operation:
** This routine writes the specified samples into files which
** are organized according to the font name and character name
** of the samples.
** Return: none
** Exceptions: none
** History: Fri Aug 18 16:17:06 1989, DSJ, Created.
*/
{ {
FILE *File; FILE *File;
STRING Filename; STRING Filename;