li_recognizer_internal.h 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. * This file is part of the UCB release of Plan 9. It is subject to the license
  3. * terms in the LICENSE file found in the top-level directory of this
  4. * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
  5. * part of the UCB release of Plan 9, including this file, may be copied,
  6. * modified, propagated, or distributed except according to the terms contained
  7. * in the LICENSE file.
  8. */
  9. /*
  10. * li_recognizer_internal.h
  11. *
  12. * Adapted from cmu_recognizer_internal.h.
  13. * Credit to Dean Rubine, Jim Kempf, and Ari Rapkin.
  14. */
  15. #define MAXSCLASSES 100
  16. typedef struct PointList {
  17. Stroke;
  18. int xrange, yrange;
  19. struct PointList* next;
  20. } point_list;
  21. typedef struct {
  22. char* file_name; /*The classifier file name.*/
  23. int nclasses; /*Number of symbols in class */
  24. point_list* ex[MAXSCLASSES]; /*The training examples.*/
  25. char* cnames[MAXSCLASSES]; /*The class names.*/
  26. point_list* canonex[MAXSCLASSES]; /*Canonicalized vrsions of strokes */
  27. point_list* dompts[MAXSCLASSES]; /*Dominant points */
  28. } rClassifier;
  29. /*This structure contains extra fields for instance-specific data.*/
  30. typedef struct {
  31. /*Instance-specific data.*/
  32. uint li_magic; /*Just to make sure nobody's cheating.*/
  33. rClassifier li_rc; /*The character classifier.*/
  34. } li_recognizer;
  35. /*Name of the default classifier file.*/
  36. #define LI_DEFAULT_CLASSIFIER_FILE "default.cl"
  37. /*Classifier file extension.*/
  38. #define LI_CLASSIFIER_EXTENSION ".cl"
  39. /*Locale supported by recognizer.*/
  40. #define LI_SUPPORTED_LOCALE REC_DEFAULT_LOCALE