wid.h File Reference

coversion of dictionary ID to LM ID. More...

#include <s3types.h>
#include "dict.h"
#include "lm.h"

Go to the source code of this file.

Functions

s3lmwid32_twid_dict_lm_map (dict_t *dict, lm_t *lm, int32 lw)
int32 wid_wordprob2alt (dict_t *dict, wordprob_t *wp, int32 n)

Detailed Description

coversion of dictionary ID to LM ID.


Function Documentation

s3lmwid32_t* wid_dict_lm_map ( dict_t dict,
lm_t lm,
int32  lw 
)

Create mappings between dictionary and LM word-IDs. In short:

  • An array of s3lmwid32_t entries (map[]) is created; where map[i] is the LM word-ID for the dictionary word-ID i. Mappings are created for the alternative pronunciations as well. For words not in the LM, the corresponding entries are BAD_LMWID(lm).
  • Similarly, lm->ug[u].dictwid is assigned the dictionary word id for unigram word u. Return value: The map[] array built as described above.
Parameters:
dict In: Dictionary
lm In/Out: LM; lm->ug[].dictwid values are updated.
lw In: Language Weight
int32 wid_wordprob2alt ( dict_t dict,
wordprob_t wp,
int32  n 
)

Augment the given wordprob array with alternative pronunciations from the dictionary. Return value: #entries in the augmented wordprob array (including the original ones).

Parameters:
dict In: Dictionary
wp In/Out: Input wordprob array, to be augmented with alternative pronunciations for the entries that already exist in it. Caller must have allocated this array.
n In: #Input entries in the wordprob array

Generated on 7 Mar 2010 by  doxygen 1.6.1