|
Public Member Functions |
| BOSS_Unitselection (BOSS::Config &_cl, MySQL_Handler *_db) |
| BOSS_Unitselection constructor.
|
| ~BOSS_Unitselection () |
| BOSS_Unitselection destructor.
|
void | operator() (xercesc::DOMNode *sentence) |
virtual string | getDescription () |
| Returns a description string of this module.
|
Private Member Functions |
bool | 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 | 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 | 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 | 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 | 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.
|
Private Attributes |
UnitLevel * | word |
UnitLevel * | syllable |
UnitLevel * | phone |
UnitLevel * | halfphone |
UnitSelectionFactory * | factory |
Cost * | unit_cost |
string | lang |