dict2pid.c File Reference
`#include <string.h>`
`#include "dict2pid.h"`
`#include "hmm.h"`

Go to the source code of this file.

## Functions

void | compress_table (s3ssid_t *uncomp_tab, s3ssid_t *com_tab, s3cipid_t *ci_map, int32 n_ci)
int32 | get_rc_nssid (dict2pid_t *d2p, s3wid_t w)
| ARCHAN, A duplicate of get_rc_npid in ctxt_table.h. More...
s3cipid_t * | dict2pid_get_rcmap (dict2pid_t *d2p, s3wid_t w)
| Get RC map. More...
int | dict2pid_add_word (dict2pid_t *d2p, int32 wid)
| Add a word to the dict2pid structure (after adding it to dict).
s3ssid_t | dict2pid_internal (dict2pid_t *d2p, int32 wid, int pos)
| Return the senone sequence ID for the given word position.
dict2pid_t * | dict2pid_build (bin_mdef_t *mdef, dict_t *dict)
| Build the dict2pid structure for the given model/dictionary. More...
dict2pid_t * | dict2pid_retain (dict2pid_t *d2p)
| Retain a pointer to dict2pid.
int | dict2pid_free (dict2pid_t *d2p)
| Free the memory dict2pid structure. More...
void | dict2pid_report (dict2pid_t *d2p)
| Report a dict2pid data structure. More...
void | dict2pid_dump (FILE *fp, dict2pid_t *d2p)
| For debugging. More...

## Detailed Description

- dictionary word to senone sequence mappings

Definition in file dict2pid.c.

## Function Documentation

## compress_table()

void compress_table | ( | s3ssid_t * | uncomp_tab,
|  | s3ssid_t * | com_tab,
|  | s3cipid_t * | ci_map,
|  | int32 | n_ci
| ) |  |

Compress this map

Definition at line 49 of file dict2pid.c.

References BAD_S3CIPID, and BAD_S3SSID.

## dict2pid_build()

dict2pid_t* dict2pid_build | ( | bin_mdef_t * | mdef,
|  | dict_t * | dict
| ) |  |

Build the dict2pid structure for the given model/dictionary.

Parameters

  mdef | A model definition
  dict | An initialized dictionary

Definition at line 388 of file dict2pid.c.

References BAD_S3SSID, bin_mdef_retain(), dict2pid_t::dict, dict_retain(), dict_size, dict2pid_t::ldiph_lc, dict2pid_t::lrdiph_rc, dict2pid_t::mdef, and bin_mdef_s::n_ciphone.

Referenced by ps_load_dict().

## dict2pid_dump()

void dict2pid_dump | ( | FILE * | fp,
|  | dict2pid_t * | d2p
| ) |  |

For debugging.

Parameters

  fp | In: a file pointer
  d2p | In: a dict2pid_t structure

Definition at line 538 of file dict2pid.c.

References dict2pid_t::dict, dict_size, and dict2pid_t::mdef.

## dict2pid_free()

int dict2pid_free | ( | dict2pid_t * | d2p | ) |

Free the memory dict2pid structure.

Parameters

  d2p | In: the d2p

Definition at line 507 of file dict2pid.c.

References dict2pid_t::ldiph_lc, dict2pid_t::lrdiph_rc, and dict2pid_t::rssid.

Referenced by ps_alignment_free(), ps_free(), ps_load_dict(), ps_reinit(), ps_search_base_free(), and ps_search_base_reinit().

## dict2pid_get_rcmap()

s3cipid_t* dict2pid_get_rcmap | ( | dict2pid_t * | d2p,
|  | s3wid_t | w
| ) |  |

Get RC map.

Parameters

  d2p | In: a dict2pid
  w | In: a wid

Definition at line 229 of file dict2pid.c.

References xwdssid_t::cimap, dictword_t::ciphone, dict2pid_t::dict, dict2pid_t::lrssid, dictword_t::pronlen, dict2pid_t::rssid, and dict_t::word.

## dict2pid_report()

void dict2pid_report | ( | dict2pid_t * | d2p | ) |

Report a dict2pid data structure.

Parameters

  d2p | In: a dict2pid_t structure

Definition at line 533 of file dict2pid.c.

## get_rc_nssid()

int32 get_rc_nssid | ( | dict2pid_t * | d2p,
|  | s3wid_t | w
| ) |  |

ARCHAN, A duplicate of get_rc_npid in ctxt_table.h.

Get number of rc.

I doubt whether it is correct because the compressed map has not been checked.

Parameters

  d2p | In: a dict2pid
  w | In: a wid

Definition at line 204 of file dict2pid.c.

References dictword_t::ciphone, dict2pid_t::dict, dict2pid_t::lrssid, xwdssid_t::n_ssid, dictword_t::pronlen, dict2pid_t::rssid, and dict_t::word.