segSyntax.h File Reference

Header file for functions to create training and recognition syntax. More...

#include "segSpData.h"
#include "segGrammar.h"

Go to the source code of this file.

Data Structures

struct  segSyntaxItem
 Data structure of nodes for the syntax. More...
struct  segSyntax
 Data structure of the syntax. More...

Defines

#define EMIT   0
 node type 'emitting node'
#define NONEMIT   1
 node type 'first null node in the model'
#define NONEMIT_F   2
 node type 'final null node in the model'
#define RECOGNITION   0
 syntax type: 'recognition'
#define CLASSIFICATION   1
 syntax type: 'classification'
#define TRAINING   2
 syntax type: 'training'

Typedefs

typedef segSyntaxItem SEG_SYNTAX_ITEM
 Data structure of nodes for the syntax.
typedef segSyntax SEG_SYNTAX
 Data structure of the syntax.

Functions

int segMakeTrainingSyntax (SEG_SYNTAX *, int *, SEG_UTT_LIST_ITEM *, SEG_MODEL_SET *)
 Create 'forced alignment' syntax (for supervised training and classification).
int segMakeRecognitionSyntax (SEG_SYNTAX *, SEG_MODEL_SET *, SEG_GRAMMAR *, double, int)
 Create recognition syntax.
int segCheckSyn (SEG_MODEL_SET *, SEG_SYNTAX *)
 Display the contents of syntax for debugging.
int segFreeSyntaxMemory (SEG_SYNTAX *, int)
 Free memory allocated to training/recognition syntax.


Detailed Description

Header file for functions to create training and recognition syntax.

Date:
16 January 2007
01 July 2007 (documented)
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Note:
This code was originally created on the basis of Martin Russell & P Jackson's SEGVit Ver.3.4.
Context-sensitive (triphone) models are now fully supported.
Revision

Typedef Documentation

typedef struct segSyntax SEG_SYNTAX

Data structure of the syntax.

The syntax is an array of nodes (of struct syntaxItem), which are concatenated states of the appropriate models.

typedef struct segSyntaxItem SEG_SYNTAX_ITEM

Data structure of nodes for the syntax.

Each of the nodes includes its type, entry and exit costs, pointers to predecessors, a pointer to the model it belongs to, and a pointer to the definition of the state.


Function Documentation

int segCheckSyn ( SEG_MODEL_SET models,
SEG_SYNTAX synt 
)

Display the contents of syntax for debugging.

Parameters:
[in] models Model set (pointer to a variable of struct modelSet)
[in] synt Syntax (pointer to a variable of struct syntax)
Returns:
Number of nodes in the syntax
Author:
Yoshinori Shiga @ CVSSP, University of Surrey

int segFreeSyntaxMemory ( SEG_SYNTAX synt,
int  totStates 
)

Free memory allocated to training/recognition syntax.

Parameters:
[in] synt Syntax
[in] totStates Number of states in the syntax
Return values:
NO_ERROR 
Author:
Yoshinori Shiga @ CVSSP, University of Surrey

int segMakeRecognitionSyntax ( SEG_SYNTAX synt,
SEG_MODEL_SET models,
SEG_GRAMMAR grammar,
double  lmff,
int  recogType 
)

Create recognition syntax.

Parameters:
[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)
Return values:
RTN_ERROR Memory allocation error / Inconsistency between models
otherwise Number of nodes in the syntax
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Bug:
When an error occurs, not all memory space allocated previously in this function is freed.
Note:
Functions getGrammarPhoneId(), allocCopyStr() and segFreeSyntaxMemory() are called internally.
See also:
getGrammarPhoneId(), allocCopyStr() and segFreeSyntaxMemory()

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

Parameters:
[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
Return values:
ERROR_ALLOC Memory allocation error
RTN_ERROR A label in utt cannot be found in models
otherwise Number of nodes in the syntax
Author:
Yoshinori Shiga @ CVSSP, University of Surrey
Bug:
When an error occurs, not all memory space allocated previously in this function is freed.
Note:
Functions extractCentrePhone() and segFreeSyntaxMemory() are called internally.
See also:
extractCentrePhone() and segFreeSyntaxMemory()


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