train.m



	   
/*-------------------------------------------------------------------------------
This file is the application that trains MKComposer. It opens the .cpt files 
passed into it and passes them on to the MKComposer object for analysis. 

The code contained in this file is under copyright and is strictly private. 

Written by Michael Krzyzaniak 
krzyzani@uga.edu
-------------------------------------------------------------------------------*/

#import "MKCptComposer.h"

int main(int argc, char* argv[])
{
  if(argc<2)  {  printf("invoke with training files (*.cpt)\n"); return -1;  }
  MKCptComposer* composer = [[MKCptComposer alloc] init];
  MKArray* cptArray = [[MKArray alloc] init];
  
  while(--argc)
    {
      argv++;
      MKCptFile* newFile = [MKCptFile cptFileFromFile: *argv];
      if(newFile != nil)
	{
	  [cptArray addObject: newFile];
	  printf("%s OK\n", *argv);
	}
      else  printf("%s is not valid\n", *argv);  
    }
  
  [[composer brain] scramble];
  [composer trainWithCptFiles: cptArray];
  
  [cptArray free];
  [composer free];
  
  return 0;
}

    




:/ root#





[an error occurred while processing this directive]