gok-predictor

## gok-predictor gok-predictor |

## Synopsis

    #define             GOK_PREDICTOR_MAX_VERTICES
    Gok_Predictor       gok_predictor_open                  ();
    void                gok_predictor_close                 (const Gok_Predictor gok_predictor);
    void                gok_predictor_add_key               (const Gok_Predictor gok_predictor,
                                                             const Command_Vertex_Data vertex_data);
    const Arraylist     gok_predictor_get                   (const Gok_Predictor gok_predictor,
                                                             const int num_predictions,
                                                             const char *keyboard_id,
                                                             const Prediction_Algorithm algorithm);
    void                gok_predictor_remove_keyboard       (const Gok_Predictor gok_predictor,
                                                             const char *keyboard_id);
    void                gok_predictor_remove_key            (const Gok_Predictor gok_predictor,
                                                             const Command_Vertex_Data vertex_data);
    void                gok_predictor_on                    (gboolean bOnOff);
    void                gok_predictor_change_number_predictions
                                                            (int Number);
    gboolean            gok_predictor_add_prediction_keys   (GokKeyboard *pKeyboard);
    int                 gok_predictor_predict               (Gok_Predictor gP);
    GokKey*             gok_predictor_get_real              (gchar *pKeyboardName,
                                                             gchar *pKeyLabel);
    void                gok_predictor_log                   (Gok_Predictor gP,
                                                             gchar *keyboardID,
                                                             gchar *keyID);
    Gok_Predictor       gok_main_get_command_predictor      (void);

## Description

## Details

### GOK_PREDICTOR_MAX_VERTICES

    #define GOK_PREDICTOR_MAX_VERTICES 1000

### gok_predictor_open ()

    Gok_Predictor       gok_predictor_open                  ();

Initialization function. If a session file exists, it will recreate the previous state.

Returns : | a new Gok_Predictor object.

### gok_predictor_close ()

    void                gok_predictor_close                 (const Gok_Predictor gok_predictor);

Tear down function. Releases the resources used by a Gok_Predictor object. Also dumps the data to a session file.

`gok_predictor` : | the instance of Gok_Predictor object to destroy

### gok_predictor_add_key ()

    void                gok_predictor_add_key               (const Gok_Predictor gok_predictor,
                                                             const Command_Vertex_Data vertex_data);

Adds a key to be used for upcoming predictions.

`gok_predictor` : | the instance of Gok_Predictor object
`vertex_data` : | a Command_Vertex_Data object that is created by command_vertex_data_create(char *keyboard_id, char *key_id, COMMAND_VERTEX_DATA_DEFAULT_WEIGHT)

### gok_predictor_get ()

    const Arraylist     gok_predictor_get                   (const Gok_Predictor gok_predictor,
                                                             const int num_predictions,
                                                             const char *keyboard_id,
                                                             const Prediction_Algorithm algorithm);

Gets the next n predictions according to the algorithm.

`gok_predictor` : | the instance of Gok_Predictor object
`num_predictions` : | number of key predictions to return
`keyboard_id` : | NOT IMPLEMENTED
`algorithm` : | an enumerated type that defines the algorithm used for the prediction
Returns : | an Arraylist of Command_Vertex_Data objects

### gok_predictor_remove_keyboard ()

    void                gok_predictor_remove_keyboard       (const Gok_Predictor gok_predictor,
                                                             const char *keyboard_id);

Function to remove a whole keyboard from the prediction.

`gok_predictor` : | the instance of Gok_Predictor object
`keyboard_id` : | id of keyboard to remove from prediction

### gok_predictor_remove_key ()

    void                gok_predictor_remove_key            (const Gok_Predictor gok_predictor,
                                                             const Command_Vertex_Data vertex_data);

Function to remove a key from the prediction.

`gok_predictor` : | the instance of Gok_Predictor object
`vertex_data` : | a Command_Vertex_Data object that is created by command_vertex_data_create(char *keyboard_id, char *key_id, COMMAND_VERTEX_DATA_DEFAULT_WEIGHT)

### gok_predictor_on ()

    void                gok_predictor_on                    (gboolean bOnOff);

Turns on (or off) the predictor. This adds (or removes) the predictor keys to every keyboard that supports command prediction.

`bOnOff` : |

### gok_predictor_change_number_predictions ()

    void                gok_predictor_change_number_predictions
                                                            (int Number);

`Number`: Number of prediction keys.

Changes the number of word prediction keys displayed on the keyboard. This should be called after the user has selected a new number from the settings dialog.

`Number` : |

### gok_predictor_add_prediction_keys ()

    gboolean            gok_predictor_add_prediction_keys   (GokKeyboard *pKeyboard);

`pKeyboard`: Pointer to the keyboard that gets the new prediction keys.

Adds a row of prediction keys to the given keyboard.

`pKeyboard` : |
Returns : | TRUE if the prediction keys were added, FALSE if not.

### gok_predictor_predict ()

    int                 gok_predictor_predict               (Gok_Predictor gP);

Makes a prediction. If the currently displayed keyboard is showing prediction keys then they are filled in with the predictions.

`gP` : |
Returns : | The number of words predicted.

### gok_predictor_get_real ()

    GokKey*             gok_predictor_get_real              (gchar *pKeyboardName,
                                                             gchar *pKeyLabel);

`pKeyboardName` : |
`pKeyLabel` : |
Returns : |

### gok_predictor_log ()

    void                gok_predictor_log                   (Gok_Predictor gP,
                                                             gchar *keyboardID,
                                                             gchar *keyID);

`gP` : |
`keyboardID` : |
`keyID` : |

### gok_main_get_command_predictor ()

    Gok_Predictor       gok_main_get_command_predictor      (void);

Accessor function.

Returns : | A pointer to command prediction engine