segGrammar.c File Reference

Functions to load a bigram grammar file. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include "segCommon.h"
#include "segStdLib.h"
#include "segGrammar.h"

Functions

int segReadGrammar (SEG_GRAMMAR *grammar, char *gramFName, SEG_MODEL_SET *models)
 Read bigram grammar (bigram posterior probability table).


Detailed Description

Functions to load a bigram grammar file.

Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Date:
30 June 2007
Note:
This code is written based on M Russell and P Jackson's SEGVit ver.3.4.
Revision

Function Documentation

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).

Parameters:
[in] grammar Grammar (bigram posterior probability table)
[in] gramFName Name of the grammar file
[in] models Model set
Return values:
ERROR_ALLOC Memory allocation error
ERROR_FOPEN File open error
RTN_ERROR File read error (bad format)
NO_ERROR Successfully executed
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This function calls logProb() and freeGrammar() internally.
See also:
logProb() and freeGrammar()


Generated on Sun Aug 5 02:40:37 2007 for SEGRec Version 1.0 by  doxygen 1.5.1