libjulius/src/confnet.c File Reference

Confusion network generation. More...

#include <julius/julius.h>

Go to the source code of this file.

Defines

#define PREFER_GRAPH_CM
 Define to enable debug output.
#define BUNDLE_WORD_WITH_SAME_OUTPUT
 Julius identify the words by their dictionary IDs, so words with different entries are treated as a different word.
#define m2i(A, B)   (B) * order_matrix_count + (A)
 Macro to access the order matrix.

Functions

static boolean is_same_word (WORD_ID w1, WORD_ID w2, WORD_INFO *winfo)
 Determine whether the two words are idential in confusion network generation.
static boolean graph_ordered (int i, int j)
 Judge order between two words by their word graph ID.
static void graph_update_order ()
 Scan the order matrix to update it at initial step and after word (set) marging.
void graph_make_order (WordGraph *root, RecogProcess *r)
 Extract order relationship between any two words in the word graph for confusion network generation.
void graph_free_order ()
 Free the order relation data.
static CN_CLUSTERcn_new ()
 Create a new cluster holder.
static void cn_free (CN_CLUSTER *c)
 Free a cluster holder.
void cn_free_all (CN_CLUSTER **croot)
 Free all cluster holders.
static void cn_add_wg (CN_CLUSTER *c, WordGraph *wg)
 Add a graph word to a cluster holder.
static void cn_merge (CN_CLUSTER *dst, CN_CLUSTER *src)
 Merge a cluster holder into another.
static void cn_destroy (CN_CLUSTER *target, CN_CLUSTER **root)
 Erase a cluster holder and remove it from the list.
static void cn_build_wordlist (CN_CLUSTER *c, WORD_INFO *winfo)
 Build / update word list from graph words for a cluster holder.
static int compare_cluster (CN_CLUSTER **x, CN_CLUSTER **y)
 qsort callback to sort clusters by their time order.
static PROB get_intraword_similarity (WordGraph *w1, WordGraph *w2)
 Compute intra-word similarity of two graph words for confusion network generation.
static PROB get_cluster_intraword_similarity (CN_CLUSTER *c1, CN_CLUSTER *c2, WORD_INFO *winfo)
 Compute intra-word similarity of two clusters.
static int minimum (int a, int b, int c)
 Return minimum value of the three arguments.
static int edit_distance (WORD_ID w1, WORD_ID w2, WORD_INFO *winfo)
 Calculate Levenstein distance (edit distance) of two words.
static PROB get_cluster_interword_similarity (CN_CLUSTER *c1, CN_CLUSTER *c2, WORD_INFO *winfo)
 Compute inter-word similarity of two clusters.
CN_CLUSTERconfnet_create (WordGraph *root, RecogProcess *r)
 Create a confusion network from word graph.

Variables

static char * order_matrix = NULL
 Temporal matrix work area to hold the order relations between words.
static int order_matrix_count
 Number of words to be expressed in the order matrix.


Detailed Description

Confusion network generation.

Generate confusion network from the obtained word lattice.

Author:
Akinobu Lee
Date:
Thu Aug 16 00:15:51 2007
Revision
1.1.1.1

Definition in file confnet.c.


Define Documentation

#define PREFER_GRAPH_CM

Define to enable debug output.

Define to enable further debug output. Use graph-based CM for confusion network generation. If not defined search-based CM (default of old julius) will be used. However, the clustering process does not work properly with this definition, since sum of the search- based CM for a word set on the same position is not always 1.0. Thus you'd better always define this.

Definition at line 52 of file confnet.c.

#define BUNDLE_WORD_WITH_SAME_OUTPUT

Julius identify the words by their dictionary IDs, so words with different entries are treated as a different word.

If this is defined, Julius treat words with the same output string as same words and bundle them in confusion network generation.

Definition at line 61 of file confnet.c.

Referenced by is_same_word().


Function Documentation

static boolean is_same_word ( WORD_ID  w1,
WORD_ID  w2,
WORD_INFO winfo 
) [static]

Determine whether the two words are idential in confusion network generation.

Parameters:
w1 [in] first word
w2 [in] second word
winfo [in] word dictionary
Returns:
TRUE if they are idential, FALSE if not.

Definition at line 75 of file confnet.c.

Referenced by cn_build_wordlist(), and get_cluster_intraword_similarity().

static boolean graph_ordered ( int  i,
int  j 
) [static]

Judge order between two words by their word graph ID.

Parameters:
i [in] id of left graph word
j [in] id of right graph word
Returns:
TRUE if they are ordered, or FALSE if not.

Definition at line 114 of file confnet.c.

void graph_make_order ( WordGraph root,
RecogProcess r 
)

Extract order relationship between any two words in the word graph for confusion network generation.

Parameters:
root [in] root pointer to the word graph
r [in] recognition process instance

Definition at line 166 of file confnet.c.

static CN_CLUSTER* cn_new (  )  [static]

Create a new cluster holder.

Returns:
the newly allocated cluster holder.

Definition at line 229 of file confnet.c.

static void cn_free ( CN_CLUSTER c  )  [static]

Free a cluster holder.

Parameters:
c [out] a cluster holder to be released.

Definition at line 249 of file confnet.c.

Referenced by cn_destroy(), and cn_free_all().

void cn_free_all ( CN_CLUSTER **  croot  ) 

Free all cluster holders.

Parameters:
croot [out] pointer to root pointer of cluster holder list.

Definition at line 267 of file confnet.c.

Referenced by clear_result().

Here is the caller graph for this function:

static void cn_add_wg ( CN_CLUSTER c,
WordGraph wg 
) [static]

Add a graph word to a cluster holder.

Parameters:
c [out] cluster holder
wg [in] graph word to be added

Definition at line 286 of file confnet.c.

Referenced by cn_merge().

static void cn_merge ( CN_CLUSTER dst,
CN_CLUSTER src 
) [static]

Merge a cluster holder into another.

Parameters:
dst [i/o] target cluster holder
src [in] source cluster holder.

Definition at line 303 of file confnet.c.

static void cn_destroy ( CN_CLUSTER target,
CN_CLUSTER **  root 
) [static]

Erase a cluster holder and remove it from the list.

Parameters:
target [i/o] a cluster holder to be erased
root [i/o] pointer to root pointer of cluster holder list

Definition at line 334 of file confnet.c.

static void cn_build_wordlist ( CN_CLUSTER c,
WORD_INFO winfo 
) [static]

Build / update word list from graph words for a cluster holder.

Parameters:
c [i/o] cluster holder to process
winfo [in] word dictionary

Definition at line 360 of file confnet.c.

static int compare_cluster ( CN_CLUSTER **  x,
CN_CLUSTER **  y 
) [static]

qsort callback to sort clusters by their time order.

Parameters:
x [in] element 1
y [in] element 2
Returns:
order value

Definition at line 389 of file confnet.c.

static PROB get_intraword_similarity ( WordGraph w1,
WordGraph w2 
) [static]

Compute intra-word similarity of two graph words for confusion network generation.

Parameters:
w1 [in] graph word 1
w2 [in] graph word 2
Returns:
the similarity value.

Definition at line 428 of file confnet.c.

Referenced by get_cluster_intraword_similarity().

static PROB get_cluster_intraword_similarity ( CN_CLUSTER c1,
CN_CLUSTER c2,
WORD_INFO winfo 
) [static]

Compute intra-word similarity of two clusters.

Parameters:
c1 [in] cluster 1
c2 [in] cluster 2
winfo [in] word dictionary
Returns:
the maximum similarity.

Definition at line 488 of file confnet.c.

static int minimum ( int  a,
int  b,
int  c 
) [static]

Return minimum value of the three arguments.

Parameters:
a [in] value 1
b [in] value 2
c [in] value 3
Returns:
the minumum value.

Definition at line 535 of file confnet.c.

static int edit_distance ( WORD_ID  w1,
WORD_ID  w2,
WORD_INFO winfo 
) [static]

Calculate Levenstein distance (edit distance) of two words.

Parameters:
w1 [in] word ID 1
w2 [in] word ID 2
winfo [in] word dictionary
Returns:
the distance.

Definition at line 557 of file confnet.c.

static PROB get_cluster_interword_similarity ( CN_CLUSTER c1,
CN_CLUSTER c2,
WORD_INFO winfo 
) [static]

Compute inter-word similarity of two clusters.

Parameters:
c1 [in] cluster 1
c2 [in] cluster 2
winfo [in] word dictionary
Returns:
the average similarity.

Definition at line 603 of file confnet.c.

CN_CLUSTER* confnet_create ( WordGraph root,
RecogProcess r 
)

Create a confusion network from word graph.

Parameters:
root [in] root pointer of word graph
r [in] recognition process instance
Returns:
root pointer to the cluster list.

Definition at line 702 of file confnet.c.


Generated on Tue Dec 18 16:00:59 2007 for Julius by  doxygen 1.5.4