41 #define PROGRAM_FEATURE_TYPE "cn"
57 const char *Directory,
58 LIST LabeledProtoList,
72 BOOL8 WriteInsigProtos);
137 int main(
int argc,
char* argv[])
142 const char *PageName;
156 printf(
"Reading %s ...\n", PageName);
157 TrainingPage =
Efopen(PageName,
"rb");
159 100,
NULL, TrainingPage, &CharList);
160 fclose(TrainingPage);
163 printf(
"Clustering ...\n");
167 pCharList = CharList;
184 printf(
"0 significant protos for %s."
185 " Retrying clustering with MinSamples = %f%%\n",
193 if (Clusterer ==
NULL) {
194 fprintf(stderr,
"Error: NULL clusterer!\n");
223 const char *Directory,
224 LIST LabeledProtoList,
233 if (Directory !=
NULL && Directory[0] !=
'\0')
235 Filename += Directory;
238 Filename +=
"normproto";
239 printf (
"\nWriting %s ...", Filename.
string());
248 printf (
"\nError! Not enough protos for %s: %d protos"
249 " (%d significant protos"
250 ", %d insignificant protos)\n",
251 LabeledProto->
Label, N,
256 fprintf(File,
"\n%s %d\n", LabeledProto->
Label, N);
268 BOOL8 WriteSigProtos,
269 BOOL8 WriteInsigProtos)
void WritePrototype(FILE *File, uinT16 N, PROTOTYPE *Proto)
void FreeNormProtoList(LIST CharList)
FILE * Efopen(const char *Name, const char *Mode)
void InitFeatureDefs(FEATURE_DEFS_STRUCT *featuredefs)
void WriteProtos(FILE *File, uinT16 N, LIST ProtoList, BOOL8 WriteSigProtos, BOOL8 WriteInsigProtos)
struct LABELEDLISTNODE * LABELEDLIST
const char * GetNextFilename(int argc, const char *const *argv)
void WriteNormProtos(const char *Directory, LIST LabeledProtoList, CLUSTERER *Clusterer)
CLUSTERER * SetUpForClustering(const FEATURE_DEFS_STRUCT &FeatureDefs, LABELEDLIST char_sample, const char *program_feature_type)
int NumberOfProtos(LIST ProtoList, BOOL8 CountSigProtos, BOOL8 CountInsigProtos)
LIST ClusterSamples(CLUSTERER *Clusterer, CLUSTERCONFIG *Config)
void FreeProtoList(LIST *ProtoList)
int main(int argc, char **argv)
void ParseArguments(int *argc, char ***argv)
void FreeTrainingSamples(LIST CharList)
#define PROGRAM_FEATURE_TYPE
void FreeClusterer(CLUSTERER *Clusterer)
const char * string() const
void ReadTrainingSamples(const FEATURE_DEFS_STRUCT &feature_defs, const char *feature_name, int max_samples, UNICHARSET *unicharset, FILE *file, LIST *training_samples)
void WriteParamDesc(FILE *File, uinT16 N, PARAM_DESC ParamDesc[])
DECLARE_STRING_PARAM_FLAG(D)
void AddToNormProtosList(LIST *NormProtoList, LIST ProtoList, char *CharName)