diff options
author | Taru Karttunen <taruti@taruti.net> | 2011-03-30 15:46:40 +0300 |
---|---|---|
committer | Taru Karttunen <taruti@taruti.net> | 2011-03-30 15:46:40 +0300 |
commit | e5888a1ffdae813d7575f5fb02275c6bb07e5199 (patch) | |
tree | d8d51eac403f07814b9e936eed0c9a79195e2450 /sys/src/libscribble/li_recognizer_internal.h |
Import sources from 2011-03-30 iso image
Diffstat (limited to 'sys/src/libscribble/li_recognizer_internal.h')
-rwxr-xr-x | sys/src/libscribble/li_recognizer_internal.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/sys/src/libscribble/li_recognizer_internal.h b/sys/src/libscribble/li_recognizer_internal.h new file mode 100755 index 000000000..ebad8048d --- /dev/null +++ b/sys/src/libscribble/li_recognizer_internal.h @@ -0,0 +1,42 @@ +/* + * li_recognizer_internal.h + * + * Adapted from cmu_recognizer_internal.h. + * Credit to Dean Rubine, Jim Kempf, and Ari Rapkin. + */ + +#define MAXSCLASSES 100 + +typedef struct PointList { + Stroke; + int xrange, yrange; + struct PointList* next; +} point_list; + +typedef struct { + char* file_name; /*The classifier file name.*/ + int nclasses; /*Number of symbols in class */ + point_list* ex[MAXSCLASSES]; /*The training examples.*/ + char* cnames[MAXSCLASSES]; /*The class names.*/ + point_list* canonex[MAXSCLASSES]; /*Canonicalized vrsions of strokes */ + point_list* dompts[MAXSCLASSES]; /*Dominant points */ +} rClassifier; + + +/*This structure contains extra fields for instance-specific data.*/ + +typedef struct { + /*Instance-specific data.*/ + uint li_magic; /*Just to make sure nobody's cheating.*/ + rClassifier li_rc; /*The character classifier.*/ +} li_recognizer; + + +/*Name of the default classifier file.*/ +#define LI_DEFAULT_CLASSIFIER_FILE "default.cl" + +/*Classifier file extension.*/ +#define LI_CLASSIFIER_EXTENSION ".cl" + +/*Locale supported by recognizer.*/ +#define LI_SUPPORTED_LOCALE REC_DEFAULT_LOCALE |