#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "segCommon.h"
#include "segStdLib.h"
#include "segGrammar.h"
Functions | |
static void | freeGrammar (SEG_GRAMMAR *grammar) |
Free memory space of bigram grammar (bigram posterior probability table). | |
int | segReadGrammar (SEG_GRAMMAR *grammar, char *gramFName, SEG_MODEL_SET *models) |
Read bigram grammar (bigram posterior probability table). |
static void freeGrammar | ( | SEG_GRAMMAR * | grammar | ) | [static] |
Free memory space of bigram grammar (bigram posterior probability table).
This function frees memory space of the variable of struct grammar (SEG_GRAMMAR).
[in] | grammar | Grammar (bigram posterior probability table) |
int segReadGrammar | ( | SEG_GRAMMAR * | grammar, | |
char * | gramFName, | |||
SEG_MODEL_SET * | models | |||
) |
Read bigram grammar (bigram posterior probability table).
This function loads bigram probability table, and store it in a variable of struct grammar (SEG_GRAMMAR).
[in] | grammar | Grammar (bigram posterior probability table) |
[in] | gramFName | Name of the grammar file |
[in] | models | Model set |
ERROR_ALLOC | Memory allocation error | |
ERROR_FOPEN | File open error | |
RTN_ERROR | File read error (bad format) | |
NO_ERROR | Successfully executed |