| WritRecogn Reference Manual | ||||
|---|---|---|---|---|
enum RadicalType; RadicalArray; ProgramAssociate; typedef RadicalCode; typedef CoordTree; typedef RawStrokeNode; typedef Radical; typedef RawStroke; typedef AbsCharacter; typedef FullCharacter; typedef RadicalList; #define DEFAULT_RADICAL_GM_INDEX typedef RadicalGM; #define DEFAULT_RAWWRITING_INDEX RawWriting; #define RADICAL (obj) #define RAWSTROKE (obj) #define ABSCHARACTER (obj) #define FULLCHARACTER (obj) #define RADICAL_GM (obj) #define RADICAL_LIST (obj) enum InputMethod; InputCodeRec; enum SupportedLanguage; typedef LanguageSet; enum MainProgramCmd; ProgFlags; enum TaskOutput; #define MAX_UNICHAR_CODE_LENGTH #define MAX_CHAR_CODE_LENGTH typedef Hypothesis; typedef CharacterMatcher; typedef StrokeNoiseReducer; typedef RadicalRecognizer; typedef SVM_MODEL; typedef SVM_PARAMETER; typedef SVM_PROBLEM; typedef SVM_NODE; enum RAW_STROKE_FEATURES; typedef SVM_FEATURES; enum RadicalField; enum QueryRelation; RadicalQueryItem; typedef RadicalQuery; typedef SQLite; typedef CharacterDataFile; ProgressData; TrainingProgressData; TrainingProgressData* (*TrainingProgressFunc) (RadicalRecognizer *recognizer, RadicalList *radicalList); #define CHARACTER_DATAFILE (obj) enum DisplayMode;
typedef enum {
RADICAL_TYPE_RADICAL,
RADICAL_TYPE_RAWSTROKE,
RADICAL_TYPE_ABSCHARACTER,
RADICAL_TYPE_FULLCHARACTER,
} RadicalType;
An enumeration of radical type. Usually used to indicate the desired type of radical to be returned, or type of radicals that radical array stores.
typedef struct {
RadicalType type;
GPtrArray *radArray;
} RadicalArray;
The RadicalArray struct contains the public fields of a Radical Array.
see_also: WritRecogn-RadicalArray
RadicalType |
Type of radical this array stores. See RadicalType for details |
GPtrArray * |
The array of radical pointers |
typedef struct {
MainProgramCmd progCmd;
Subroutine subroutine;
ProgFlags flags;
gchar *usageMsg;
DisplayMode displayMode;
RadicalList *currRadicalList;
CharacterMatcher *charMatcher;
RadicalRecognizer *recognizer;
StrokeNoiseReducer *strokeNoiseReducer;
CharacterDataFile *characterDataFile;
gchar characterDataFileName[PATH_MAX];
gchar strokeHypothesisFileName[PATH_MAX];
ChooseFilenameFunc choose_open_callback;
ChooseFilenameFunc choose_save_callback;
TrainingProgressFunc training_progress_callback;
} ProgramAssociate;
Program associate stores global parameters and variables.
typedef GTree CoordTree;
Tree of sorted integer pairs which represent bounding points. It is mainly for Relative Radical Bounding Box.
typedef Coordinate2D RawStrokeNode;
Data structure for a 2-D point which represent node of handwriting stroke.
typedef struct _writRecognAbsCharacter AbsCharacter;
A short alias of writRecognAbsCharacter.
typedef struct _writRecognFullCharacter FullCharacter;
A short alias of writRecognFullCharacter.,
typedef struct _writRecognRadical_list RadicalList;
A short alias of writRecognRadical_list.
typedef struct _writRecognRadical_geometry_model RadicalGM;
A short alias of writRecognRadical_geometry_model.
typedef struct {
gint writingId;
RadicalArray *rStrokeArray;
} RawWriting;
A RawWriting instance demonstrates how this character are written by a user.
gint |
a serial number that identifies a RawWriting, start at 1. |
RadicalArray * |
a radical array that shows how a character is formed by RawStrokes. |
#define RADICAL(obj) WRITRECOGN_RADICAL(obj)
Cast the given object as Radical.
|
the object to be casted. |
#define RAWSTROKE(obj) WRITRECOGN_RAWSTROKE(obj)
Cast the given object as RawStroke.
|
the object to be casted |
#define ABSCHARACTER(obj) WRITRECOGN_ABSCHARACTER(obj)
Cast the given object as AbsCharacter.
|
the object to be casted. |
#define FULLCHARACTER(obj) WRITRECOGN_FULLCHARACTER(obj)
Cast the given object as FullCharacter.
|
the object to be casted. |
#define RADICAL_GM(obj) WRITRECOGN_RADICAL_GEOMETRY_MODEL(obj)
Cast the given object as RadicalGM.
|
the object to be casted. |
#define RADICAL_LIST(obj) WRITRECOGN_RADICAL_LIST(obj)
Cast the given object as RadicalList.
|
the object to be casted. |
typedef enum{
STROKE_SEQUENCE,
WUBI98,
IM_OTHER,
IM_NOT_SPECIFIED,
IM_INVALID,
} InputMethod;
An enumeration for input method.
typedef struct {
InputMethod method;
gchar *inputCode;
} InputCodeRec;
An input code record consists the input code and its corresponding input method.
InputMethod |
Input method |
gchar * |
Input code. |
typedef enum {
LANG_UNLABELED=0,
LANG_NUMBER,
LANG_SYMBOL,
LANG_EN,
LANG_JP,
LANG_KR,
LANG_ZH_SIMPLIFIED,
LANG_ZH_TRADITIONAL,
} SupportedLanguage;
An enumeration for supported language. Note that a character might be multi-labeled.
| The character does not appear in any supported language. | |
| The character is numerical. | |
| The character is a symbol. | |
| The character is an English alphabet. | |
| The character appears in Japanese. | |
| The character appears in Korean. | |
| The character appears in simplified Chinese. | |
| The character appears in traditional Chinese. |
typedef GArray LanguageSet;
Set of supported languages. Because character might appears in multiple languages. For example, character 天 appears in Japanese, simplified and traditional Chinese.
see_also: SupportedLanguage.
typedef enum{
RECOGNIZER=0,
CHARACTER_DATA_MANAGER
} MainProgramCmd;
An enumeration of main program
typedef struct {
unsigned guiFlag: 1;
unsigned trainingFlag: 1;
unsigned characterDataModified: 1;
unsigned hypothesisModified: 1;
unsigned canvasModified: 1;
/**
* FALSE before gtk_widget_show(mainWindowWidget); TRUE otherwise.
*/
unsigned initializedFlag: 1;
} ProgFlags;
Status flags for ProgramAssociate.
typedef enum{
TASK_RUNNING,
TASK_CANCELED,
TASK_FAILED,
TASK_COMPLETED
} TaskOutput;
An enumeration of task running status.
typedef struct _writRecognCharacter_matcher CharacterMatcher;
A short alias of writRecognCharacter_matcher.
typedef struct _writRecognStroke_noise_reducer StrokeNoiseReducer;
A short alias of writRecognStroke_noise_reducer.
typedef struct _writRecognRadical_recognizer RadicalRecognizer;
A short alias of writRecognRadical_recognizer.
typedef enum {
NUM_OF_MIDDLE_RAW_STROKE_NODE = 1,
FARTHEST_DISTANCE,
DEPRESSION_ANGLE,
// DIRECT_LENGTH,
} RAW_STROKE_FEATURES;
An enumeration of raw stroke features which are considered in stroke recognition. Chord is the line segment from starting stroke node to ending stroke node.
typedef enum {
RADICAL_FIELD_RADICAL_CODE,
RADICAL_FIELD_INPUT_METHOD,
RADICAL_FIELD_INPUT_CODE,
RADICAL_FIELD_LANG,
RADICAL_FIELD_VAR_RADICAL,
} RadicalField;
An enumeration of search field types. RadicalQuery.
| Indicate the field is radical code. | |
| Indicate the field is input method. | |
| Indicate the field is input code. | |
| Indicate the field is input code. | |
| Indicate the filed is radical code of variant character. |
typedef enum {
QUERY_RELATION_EQUAL,
QUERY_RELATION_NOT_EQUAL,
QUERY_RELATION_LESS_THAN,
QUERY_RELATION_LESS_OR_EQUAL,
QUERY_RELATION_GREATER_THAN,
QUERY_RELATION_GREATER_OR_EQUAL,
} QueryRelation;
An enumeration of query relation. Used with RadicalQuery.
| The field value equals to the given value. | |
| The field value does not equal to the given value. | |
| The field value is less than the given value. | |
| The field value is less than or equals to the given value. | |
| The field value is greater than the given value. | |
| The field value is greater than or equals to the given value. |
typedef struct {
RadicalField field;
QueryRelation relation;
gchar* value;
} RadicalQueryItem;
A sub query which contains the selection criteria.
RadicalField |
The data file field. |
QueryRelation |
The relation between the field value and value.
|
gchar * |
The value for the selection criteria. |
typedef struct _writRecognCharacter_datafile CharacterDataFile;
A short alias of writRecognCharacter_datafile.
typedef struct {
int timer;
TaskOutput result;
gboolean restart;
GtkWidget *window;
GtkWidget *pbar;
} ProgressData;
Data structure necessary to show current progress. Used in a progress bar.
int |
timer for timeout. |
TaskOutput |
the running status of a thread. |
gboolean |
whether the progress has been started. |
GtkWidget * |
the dialog window widget. |
GtkWidget * |
the progress bar widget. |
typedef struct {
ProgressData pdata;
Hypothesis *hypo;
} TrainingProgressData;
Data structure for showing current training progress.
ProgressData |
progress data. |
Hypothesis * |
generated hypothesis. |
TrainingProgressData* (*TrainingProgressFunc) (RadicalRecognizer *recognizer, RadicalList *radicalList);
A prototype for training progress functions such as hypothesis training.
|
stroke recognizer |
|
radical list. |
Returns : |
the data of training progress. |
#define CHARACTER_DATAFILE(obj) WRITRECOGN_CHARACTER_DATAFILE(obj)
Cast object as CharacterDataFile
|
object to be casted. |
typedef enum{
RECOGNIZING_MODE,
TRAINING_MODE,
UNIHAN_MODE
} DisplayMode;
An enumeration of canvas and menu display mode.
| canvas shows user-drawn strokes, but not background character. Save functions are disabled. | |
| canvas shows strokes from database,background characters are from pagno (installed fonts). Save functions are enabled. | |
| canvas shows strokes from database, background characters are from UniHan. Save functions are enabled. |