Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

BOSS UnitSelection Module


Classes

class  BOSS_Node
 Language dependent graph node class for the unit selection graph path finding algorithm. More...

class  BOSS_NodeDE
 German node class. More...

class  BOSS_Unitselection
 The main class of the unit selection module. This class performs the graph pathfinding algoritm used for chosing the units for manipulation and concatenation. More...

class  Cost
 Abstract interface to language dependent CostXX classes. More...

class  CostDE
 Cost class used for german language. More...

class  UnitSelectionFactory
 Base class for generation of language dependent components used by the non-uniform unit selection algorithm. First an instance of unit selection factory for one language is created. This factory can be used to create instances of the desired types. More...

class  UnitSelectionFactoryDE
 Factory implementation for generation of german cost and node classes. More...

struct  PreSelAttr
 A structure storing preselection attributes. More...

class  UnitLevel
 Data structure holding attributes of one speech unit level (word, syllable, etc.). More...


Typedefs

typedef vector< BOSS_Node * > UNIT_Graph_Column
typedef vector< UNIT_Graph_ColumnUNIT_Graph
typedef vector< PreSelAttrPSA_Vector
 A column of preselection attribute matrix.


Functions

ostream & operator<< (ostream &out, const BOSS_Node::Node_Type &t)
ostream & operator<< (ostream &out, const BOSS_Node &n)
ostream & operator<< (ostream &out, const UNIT_Graph_Column &c)
ostream & operator<< (ostream &out, const UNIT_Graph &g)
void printUserData (const xercesc::DOMNode *node)
 This function prints the NodeName and DOM_Userdata of a DOM node. DOM_Userdata is only printed if the node is an ELEMENT_NODE, the user_data pointer not equal to zero and the field position in BOSS_Userdata not equal to DOM_UserData::npos. These conditions cause only those nodes to be printed which are selected by the unit selection algorithm. Note that this function moves through the tree recursively.

BOSS::Modulecreate (BOSS::Config &_cl, MySQL_Handler *_db)
 Creates a new instance of BOSS_Unitselection class.

void destroy (BOSS_Unitselection *cm)
 Destroys the instance of BOSS_Unitselection class.

 BOSS_Node::BOSS_Node (BOSS::Config &cl)
 BOSS_Node::BOSS_Node (const BOSS_Node &b)
 BOSS_Node::BOSS_Node (BOSS::Config &cl, const Node_Type &t)
 BOSS_Node::BOSS_Node (BOSS::Config &cl, const xercesc::DOMNode *node, const Node_Type &t, const unsigned &p)
virtual BOSS_Node::~BOSS_Node ()
BOSS_NodeBOSS_Node::operator= (const BOSS_Node &b)
 BOSS_NodeDE::BOSS_NodeDE (BOSS::Config &cl)
 BOSS_NodeDE::BOSS_NodeDE (const BOSS_Node &b)
 BOSS_NodeDE::BOSS_NodeDE (BOSS::Config &cl, const Node_Type &t)
 BOSS_NodeDE::BOSS_NodeDE (BOSS::Config &cl, const xercesc::DOMNode *node, const Node_Type &t, const unsigned &p)
 BOSS_NodeDE::~BOSS_NodeDE ()
BOSS_NodeDEBOSS_NodeDE::operator= (const BOSS_NodeDE &b)
 BOSS_Unitselection::BOSS_Unitselection (BOSS::Config &_cl, MySQL_Handler *_db)
 BOSS_Unitselection constructor.

virtual string BOSS_Unitselection::getDescription ()
 Returns a description string of this module.

 BOSS_Unitselection::~BOSS_Unitselection ()
 BOSS_Unitselection destructor.

void BOSS_Unitselection::createUnitGraph (const xercesc::DOMNode *node, UNIT_Graph &unit_graph)
 Builds a graph using BOSS_Nodes. The UNIT_Graph is the main structure for computing the shortest path. To avoid storing edges directly in the graph nodes, a table-like structure is chosen for representing the graph. Each column of this table contains the different tokens which are given by the database query. At the beginning, the results of the database queries are contained only in the DOM_UserData class. The DOM_UserData class contains all possible tokens for the relevant unit in a structure called Result. Now, BOSS_Nodes are constructed. Each node contains a node type, a pointer to the corresponding DOM_UserData class, a pointer to the corresponding Row class and a position which gives the position of the row in the Result class.

void BOSS_Unitselection::shortpath (UNIT_Graph &unit_graph)
 Computes shortest path in a graph. The shortpath function moves through the graph given by the UNIT_Graph class. It will enumerate all node pairs of subsequent columns and call the cost function. The cost function is given by the class Cost. A cost function takes one or two nodes and returns a value which is as low as the relevant unit matching the desired unit. First, the lowest value between the relevant node and all preceding nodes is located. We call this cost type transition cost and a pointer is inserted in the BOSS_Node class which marks the preceding node which leads to the lowest cost value. That costs which depend only on the relevant unit are summed up to the cost value of the relevant unit. This cost type is called unit cost. After calculating the costs, a path is given by the pred pointers contained in the BOSS_Node classes. We move along this path and set the pos value in the DOM_UserData classes to that row which contains the selected unit.

bool BOSS_Unitselection::rejectUnit (xercesc::DOMNode *node, const MySQL_Result &query_result, const unsigned &pos) const
 Marks units unsuitable for further processing. Units with high costs are rejected in the preselection functions.

void BOSS_Unitselection::PreSelection (UnitLevel *level, const xercesc::DOMNode *unit, MySQL_Result &query_result) const
 The preselection selects candidate words, syllables, phones or halfphones from the database.

void BOSS_Unitselection::unitSelect (xercesc::DOMNode *sub_tree, UnitLevel *level)
 Performs unit preselection for current unit level. This function performs the unit selection for a given sentence. It works in a recursive way using the UnitLevel class . Lets assume for the sake of simplicity of explanation that we have started at the very top sentence level. The function first queries all child nodes from the sentence. As defined in our DOM structure, it must be the word nodes or the text node of the sentence. Each node with node type ELEMENT_NODE must be a word node. Now, we try to find a set of units in the database which has the same canonical transcription as the desired word. If we find units in the database, we store them in the DOM_UserData class. Otherwise, we switch to syllable selection.

void BOSS_Unitselection::operator() (xercesc::DOMNode *sentence)
 CostDE::CostDE (BOSS::Config &__cl)
 CostDE constructor.

 CostDE::~CostDE ()
 CostDE destructor.

bool CostDE::isSibilant (const string &s) const
 Decides whether the argument is sibilant or not.

bool CostDE::isNasal (const string &s) const
 Decides whether or not the argument is a nasal.

double CostDE::stress_cost (const BOSS_Node *u) const
 Computes the cost of stress parameteres of a node.

double CostDE::phrasing_cost (const BOSS_Node *u) const
 Computes the cost of phrasing of a node.

double CostDE::duration_cost (const BOSS_Node *u) const
 Computes a duration cost of a node.

double CostDE::treal_cost (const BOSS_Node *u) const
 Assigns costs to discrepancies between the canonical transcription (TKey) and the actual realisation (TReal) of a unit.

double CostDE::operator() (const BOSS_Node *u) const
 Computes the total cost of a node.

float CostDE::mel_dist (const BOSS_Node *l, const BOSS_Node *r) const
 Computes the Euclidean distance between the mel frequency cepstrum coefficients of two nodes.

float CostDE::f0_dist (const BOSS_Node *l, const BOSS_Node *r) const
 Computes fundamental frequency distance of two nodes.

float CostDE::operator() (const BOSS_Node *l, const BOSS_Node *r)
 Computes total cost of transition between two nodes.

UnitSelectionFactoryUnitSelectionFactory::getFactory (const string lang)
 Creates a new instance of a UnitSelectionFactory dependent on a language of choice.


Typedef Documentation

typedef vector< PreSelAttr > PSA_Vector
 

A column of preselection attribute matrix.

typedef vector< UNIT_Graph_Column > UNIT_Graph
 

Todo:
TODO: no doc

typedef vector< BOSS_Node* > UNIT_Graph_Column
 

Todo:
TODO: no doc


Function Documentation

BOSS_Node::BOSS_Node BOSS::Config cl,
const xercesc::DOMNode *  node,
const Node_Type t,
const unsigned &  p
[inherited]
 

BOSS_Node::BOSS_Node BOSS::Config cl,
const Node_Type t
[inherited]
 

BOSS_Node::BOSS_Node const BOSS_Node b  )  [inherited]
 

BOSS_Node::BOSS_Node BOSS::Config cl  )  [inherited]
 

BOSS_NodeDE::BOSS_NodeDE BOSS::Config cl,
const xercesc::DOMNode *  node,
const Node_Type t,
const unsigned &  p
[inherited]
 

BOSS_NodeDE::BOSS_NodeDE BOSS::Config cl,
const Node_Type t
[inherited]
 

BOSS_NodeDE::BOSS_NodeDE const BOSS_Node b  )  [inherited]
 

BOSS_NodeDE::BOSS_NodeDE BOSS::Config cl  )  [inherited]
 

BOSS_Unitselection::BOSS_Unitselection BOSS::Config _cl,
MySQL_Handler _db
[inherited]
 

BOSS_Unitselection constructor.

Parameters:
_cl system wide configuration class
_db database handler

CostDE::CostDE BOSS::Config __cl  )  [inherited]
 

CostDE constructor.

Parameters:
__cl system wide config container

BOSS::Module* create BOSS::Config _cl,
MySQL_Handler _db
 

Creates a new instance of BOSS_Unitselection class.

void BOSS_Unitselection::createUnitGraph const xercesc::DOMNode *  node,
UNIT_Graph unit_graph
[private, inherited]
 

Builds a graph using BOSS_Nodes. The UNIT_Graph is the main structure for computing the shortest path. To avoid storing edges directly in the graph nodes, a table-like structure is chosen for representing the graph. Each column of this table contains the different tokens which are given by the database query. At the beginning, the results of the database queries are contained only in the DOM_UserData class. The DOM_UserData class contains all possible tokens for the relevant unit in a structure called Result. Now, BOSS_Nodes are constructed. Each node contains a node type, a pointer to the corresponding DOM_UserData class, a pointer to the corresponding Row class and a position which gives the position of the row in the Result class.

void destroy BOSS_Unitselection cm  ) 
 

Destroys the instance of BOSS_Unitselection class.

double CostDE::duration_cost const BOSS_Node node  )  const [private, inherited]
 

Computes a duration cost of a node.

Parameters:
node a node whose duration cost is to be computed
Returns:
duration cost of a node

float CostDE::f0_dist const BOSS_Node l_node,
const BOSS_Node r_node
const [private, inherited]
 

Computes fundamental frequency distance of two nodes.

Parameters:
l_node first node
r_node second node
Returns:
F0 distance of two nodes

string BOSS_Unitselection::getDescription  )  [virtual, inherited]
 

Returns a description string of this module.

Returns:
description string of BOSS_Unitselection module

Implements BOSS::Module.

UnitSelectionFactory * UnitSelectionFactory::getFactory const string  lang  )  [static, inherited]
 

Creates a new instance of a UnitSelectionFactory dependent on a language of choice.

Parameters:
lang language identificator
Returns:
instance of UnitSelectionFactory Currently creates only instances of UnitSelectionFactoryDE despite of the lang parameter.

bool CostDE::isNasal const string &  s  )  const [private, inherited]
 

Decides whether or not the argument is a nasal.

Parameters:
s input string
Returns:
true iff the input is a nasal, false otherwise

bool CostDE::isSibilant const string &  s  )  const [private, inherited]
 

Decides whether the argument is sibilant or not.

Parameters:
s input string
Returns:
true iff the input is a sibilant, false otherwise

float CostDE::mel_dist const BOSS_Node l_node,
const BOSS_Node r_node
const [private, inherited]
 

Computes the Euclidean distance between the mel frequency cepstrum coefficients of two nodes.

Parameters:
l_node first node
r_node second node
Returns:
Euclidean distance between the mel frequency cepstrum coefficients of two nodes.

float CostDE::operator() const BOSS_Node l_node,
const BOSS_Node r_node
[virtual, inherited]
 

Computes total cost of transition between two nodes.

Parameters:
l_node first node
r_node second node
Returns:
total transition cost of two nodes

Implements Cost.

double CostDE::operator() const BOSS_Node node  )  const [virtual, inherited]
 

Computes the total cost of a node.

Parameters:
node a node whose total cost is to be computed
Returns:
total cost of a node

Implements Cost.

void BOSS_Unitselection::operator() xercesc::DOMNode *  sentence  )  [virtual, inherited]
 

This function performs the unit selection for a given sentence.

First, it runs the preselection phase. It queries all nodes from the sentence xml document. If we find suitable units in the database, we store them in the DOM_UserData class of the relevant nodes. After retrieving all necessary units, it is possible to construct a graph. This graph has a table-like structure and contains BOSS_Nodes as nodes. We add two special nodes to the graph to have unique start and end points and compute a path in this graph by calling the shortpath function.

Implements BOSS::Module.

ostream & operator<< ostream &  out,
const UNIT_Graph g
 

ostream & operator<< ostream &  out,
const UNIT_Graph_Column c
 

ostream& operator<< ostream &  out,
const BOSS_Node n
 

ostream & operator<< ostream &  out,
const BOSS_Node::Node_Type t
 

BOSS_NodeDE & BOSS_NodeDE::operator= const BOSS_NodeDE b  )  [inherited]
 

BOSS_Node & BOSS_Node::operator= const BOSS_Node b  )  [inherited]
 

double CostDE::phrasing_cost const BOSS_Node node  )  const [private, inherited]
 

Computes the cost of phrasing of a node.

Parameters:
node a node whose phrasing cost is to be computed
Returns:
phrasing cost of a node

void BOSS_Unitselection::PreSelection UnitLevel level,
const xercesc::DOMNode *  unit,
MySQL_Result query_result
const [private, inherited]
 

The preselection selects candidate words, syllables, phones or halfphones from the database.

Parameters:
level defines the current unit level
unit a DOM node
query_result a result of preselection query

void printUserData const xercesc::DOMNode *  node  ) 
 

This function prints the NodeName and DOM_Userdata of a DOM node. DOM_Userdata is only printed if the node is an ELEMENT_NODE, the user_data pointer not equal to zero and the field position in BOSS_Userdata not equal to DOM_UserData::npos. These conditions cause only those nodes to be printed which are selected by the unit selection algorithm. Note that this function moves through the tree recursively.

Parameters:
node a DOMNode

bool BOSS_Unitselection::rejectUnit xercesc::DOMNode *  node,
const MySQL_Result query_result,
const unsigned &  pos
const [private, inherited]
 

Marks units unsuitable for further processing. Units with high costs are rejected in the preselection functions.

Parameters:
node a dom node
query_result a query result
pos is the row number of the database query result containing the chosen unit. See also dom_userdata.h
Returns:
true iff the unit is unsuitable for further processing; false otherwise

void BOSS_Unitselection::shortpath UNIT_Graph unit_graph  )  [private, inherited]
 

Computes shortest path in a graph. The shortpath function moves through the graph given by the UNIT_Graph class. It will enumerate all node pairs of subsequent columns and call the cost function. The cost function is given by the class Cost. A cost function takes one or two nodes and returns a value which is as low as the relevant unit matching the desired unit. First, the lowest value between the relevant node and all preceding nodes is located. We call this cost type transition cost and a pointer is inserted in the BOSS_Node class which marks the preceding node which leads to the lowest cost value. That costs which depend only on the relevant unit are summed up to the cost value of the relevant unit. This cost type is called unit cost. After calculating the costs, a path is given by the pred pointers contained in the BOSS_Node classes. We move along this path and set the pos value in the DOM_UserData classes to that row which contains the selected unit.

Parameters:
unit_graph a graph in which the shortest path is computed

double CostDE::stress_cost const BOSS_Node node  )  const [private, inherited]
 

Computes the cost of stress parameteres of a node.

Parameters:
node a node whose stress cost is to be computed
Returns:
stress cost of a node

double CostDE::treal_cost const BOSS_Node node  )  const [private, inherited]
 

Assigns costs to discrepancies between the canonical transcription (TKey) and the actual realisation (TReal) of a unit.

Parameters:
node a node
Returns:
Cost of discrepancies between the canonical transcription (TKey) and the actual realisation (TReal) of a unit.

void BOSS_Unitselection::unitSelect xercesc::DOMNode *  subtree,
UnitLevel level
[private, inherited]
 

Performs unit preselection for current unit level. This function performs the unit selection for a given sentence. It works in a recursive way using the UnitLevel class . Lets assume for the sake of simplicity of explanation that we have started at the very top sentence level. The function first queries all child nodes from the sentence. As defined in our DOM structure, it must be the word nodes or the text node of the sentence. Each node with node type ELEMENT_NODE must be a word node. Now, we try to find a set of units in the database which has the same canonical transcription as the desired word. If we find units in the database, we store them in the DOM_UserData class. Otherwise, we switch to syllable selection.

BOSS_Node::~BOSS_Node  )  [virtual, inherited]
 

BOSS_NodeDE::~BOSS_NodeDE  )  [inherited]
 

BOSS_Unitselection::~BOSS_Unitselection  )  [inherited]
 

BOSS_Unitselection destructor.

CostDE::~CostDE  )  [inherited]
 

CostDE destructor.


Generated on Tue Dec 20 23:14:41 2005 for BOSS by doxygen 1.3.6