#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include "segCommon.h"
#include "segStdLib.h"
#include "segSyntax.h"
Defines | |
#define | MAX_LABEL_LEN 16 |
Maximum possible number of characters for model/phone labels. | |
Functions | |
static int | getGrammarPhoneId (SEG_GRAMMAR *grammar, char *phone) |
Get model/phone ID in the grammar. | |
int | segMakeTrainingSyntax (SEG_SYNTAX *synt, int *eStates, SEG_UTT_LIST_ITEM *utt, SEG_MODEL_SET *models) |
Create 'forced alignment' syntax (for supervised training and classification). | |
int | segMakeRecognitionSyntax (SEG_SYNTAX *synt, SEG_MODEL_SET *models, SEG_GRAMMAR *grammar, double lmff, int recogType) |
Create recognition syntax. | |
int | segCheckSyn (SEG_MODEL_SET *models, SEG_SYNTAX *synt) |
Display the contents of syntax for debugging. | |
int | segFreeSyntaxMemory (SEG_SYNTAX *synt, int totStates) |
Free memory allocated to training/recognition syntax. |
static int getGrammarPhoneId | ( | SEG_GRAMMAR * | grammar, | |
char * | phone | |||
) | [static] |
Get model/phone ID in the grammar.
[in] | grammar | N-gram posterior probability table |
[in] | phone | Model/phone label string |
RTN_ERROR | The given label string was not found in the grammar | |
otherwise | ID of the model/phone in the grammar |
int segCheckSyn | ( | SEG_MODEL_SET * | models, | |
SEG_SYNTAX * | synt | |||
) |
Display the contents of syntax for debugging.
[in] | models | Model set (pointer to a variable of struct modelSet) |
[in] | synt | Syntax (pointer to a variable of struct syntax) |
int segFreeSyntaxMemory | ( | SEG_SYNTAX * | synt, | |
int | totStates | |||
) |
Free memory allocated to training/recognition syntax.
[in] | synt | Syntax |
[in] | totStates | Number of states in the syntax |
NO_ERROR |
int segMakeRecognitionSyntax | ( | SEG_SYNTAX * | synt, | |
SEG_MODEL_SET * | models, | |||
SEG_GRAMMAR * | grammar, | |||
double | lmff, | |||
int | recogType | |||
) |
Create recognition syntax.
[in,out] | synt | Syntax to be built |
[in] | models | Set of models with model parameters |
[in] | grammar | N-gram posterior probability table |
[in] | lmff | Scale factor for the language model |
[in] | recogType | Type of testing (RECOGNITION or CLASSIFICATION) |
RTN_ERROR | Memory allocation error / Inconsistency between models | |
otherwise | Number of nodes in the syntax |
int segMakeTrainingSyntax | ( | SEG_SYNTAX * | synt, | |
int * | eStates, | |||
SEG_UTT_LIST_ITEM * | utt, | |||
SEG_MODEL_SET * | models | |||
) |
Create 'forced alignment' syntax (for supervised training and classification).
[in,out] | synt | Syntax to be built |
[in,out] | eStates | Number of emitting states |
[in] | models | Set of models with model parameters |
[in] | utt | Utterance |
ERROR_ALLOC | Memory allocation error | |
RTN_ERROR | A label in utt cannot be found in models | |
otherwise | Number of nodes in the syntax |