SPRAAK
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Groups Pages
Data Structures | Typedefs | Enumerations | Functions | Variables
wlat_master.c File Reference

Define the word lattice interface and provide the word lattice IO & hash operations. More...

Data Structures

struct  SprWlatO
 
struct  SprWlatC
 
struct  SprWlatA
 
struct  SprWlatR
 
struct  SprWlatS
 
struct  SprWlatEIDD
 
union  _Union1_WLAT_MASTER_
 
struct  SprWlatEI
 
union  _Union2_WLAT_MASTER_
 
struct  SprWlatEvent
 
struct  SprWlatList
 
struct  SprWlatModInf
 
struct  SprWlatModule
 
struct  SprWlatPipe
 
struct  SprWlatHTE
 
union  _Union6_WLAT_MASTER_
 
struct  SprWlatHTDB
 hash data block More...
 
struct  SprWlatHT1
 
struct  SprWlatHTH
 
struct  SprWlatHT2
 

Typedefs

typedef const SprWlatEvent *(* _FuncPtr3_WLAT_MASTER_ )(unsigned int port, const SprWlatEvent *event, const struct spr_t_wlat_module *module)
 
typedef int(* _FuncPtr4_WLAT_MASTER_ )(struct spr_t_wlat_module *module, const char **descript, const SprCmdDesc **help)
 
typedef const SprWlatEvent *(* _FuncPtr5_WLAT_MASTER_ )(unsigned int port, const SprWlatEvent *event, const struct spr_t_wlat_module *module)
 

Enumerations

enum  { SPR_WLAT_ARC_EPS }
 
enum  {
  SPR_WLAT_ARC, SPR_WLAT_ONODE, SPR_WLAT_CNODE, SPR_WLAT_REMARK,
  SPR_WLAT_STOP, SPR_WLAT_START, SPR_WLAT_END, SPR_WLAT_INIT,
  SPR_WLAT_DARC, SPR_WLAT_RARC, SPR_WLAT_MODE_MSK, SPR_WLAT_HAS_OPT1,
  SPR_WLAT_HAS_OPT2, SPR_WLAT_HAS_OPT3, SPR_WLAT_RESERVED_MSK, SPR_WLAT_USR_FLAG1,
  SPR_WLAT_USR_FLAG2, SPR_WLAT_USR_FLAG3, SPR_WLAT_USR_FLAG4
}
 

Functions

void spr_wlat_ei_free_triv (SprWlatEI *ei)
 
SprWlatHT1spr_wlat_hash1_free (SprWlatHT1 *ht)
 
void spr_wlat_hash1_reset (SprWlatHT1 *ht)
 
SprWlatHT1spr_wlat_hash1_init (SprWlatHT1 *htx, unsigned int initial_size, unsigned int el_data_sz)
 
SprWlatHTEspr_wlat_hash1_find_el (const SprWlatHT1 *ht, int node_ndx)
 
int spr_wlat_hash1_find_ndx (const SprWlatHT1 *ht, int node_ndx)
 
int spr_wlat_hash1_del_el (SprWlatHT1 *ht, int node_ndx)
 
int spr_wlat_hash1_add_ndx (SprWlatHT1 *ht, int node_ndx, const void *data)
 
void * spr_wlat_hash1_add_el (SprWlatHT1 *ht, int node_ndx)
 
SprWlatHTEspr_wlat_hash1_ndx2el (SprWlatHT1 *ht, unsigned int ndx)
 
int spr_wlat_hash1_next (SprWlatHT1 *ht, unsigned int ndx)
 
SprWlatHT2spr_wlat_hash2_free (SprWlatHT2 *ht)
 
SprWlatHTHspr_wlat_hash2_reset (SprWlatHT2 *ht, SprWlatHTH *cat_free_list)
 
SprWlatHT2spr_wlat_hash2_init (SprWlatHT2 *htx, unsigned int initial_size)
 
SprWlatHTHspr_wlat_hash2_find_el (const SprWlatHT2 *ht, int node_ndx)
 
SprWlatHTHspr_wlat_hash2_del_el (SprWlatHT2 *ht, int node_ndx)
 
SprWlatHTHspr_wlat_hash2_add_el (SprWlatHT2 *ht, SprWlatHTH *el)
 
const char * spr_wlat_next_line (const char ***line_array)
 
const SprWlatEventspr_wlat_propagate_event (unsigned int output_port, const SprWlatEvent *event, const SprWlatModule *wlat_module)
 
int spr_wlat_root_setup (SprWlatModule *module, const char **descript, const SprCmdDesc **help)
 
int spr_wlat_read_setup (SprWlatModule *module, const char **descript, const SprCmdDesc **help)
 
int spr_wlat_write_setup (SprWlatModule *module, const char **descript, const SprCmdDesc **help)
 
int spr_wlat_filter_setup (SprWlatModule *module, const char **descript, const SprCmdDesc **help)
 
int spr_wlat_check_setup (SprWlatModule *module, const char **descript, const SprCmdDesc **help)
 
SprWlatPipespr_wlat_pipe_free (SprWlatPipe *wlat_pipe)
 
SprWlatPipespr_wlat_pipe_setup (const char **line_array)
 
void spr_wlat_pipe_dump (SprStream *fd, const SprWlatPipe *wlat_pipe)
 
void spr_wlat_pipe_help (SprStream *fd)
 Print the syntax of all possible commands and modules. More...
 
int spr_wlat_pipe_process (const SprWlatPipe *wlat_pipe)
 
int spr_wlat_install_root_reader (SprWlatPipe *wlat_pipe, const char *fname)
 

Variables

const SprWlatEIDD spr_wlat_ei_dd_null
 
SprWlatEI *const spr_wlat_ei_null
 
const SprWlatEIDD spr_wlat_ei_dd_string
 
const int *const spr_wlat_dummy_lm_wsets []
 negative ID's are interpreted as word sets by the LM routines More...
 
const SprWlatModInf spr_wlat_mi_root
 
const SprWlatModInf spr_wlat_mi_read
 
const SprWlatModInf spr_wlat_mi_write
 
const SprWlatModInf spr_wlat_mi_filter
 
const SprWlatModInf spr_wlat_mi_check
 

Detailed Description

Define the word lattice interface and provide the word lattice IO & hash operations.

Define the word lattice interface and provide the word lattice IO & hash operations

Lattices have the following format when written on disk:

Each lattice start with a

File: <fname> [btime] [etime] ....

line indicating the file (or part thereof) the set of arcs and nodes following this line describe. The lattice itself is an FST, and consist of nodes, arcs and comment lines. Nodes are opened and close on a demand basis as to allow streaming lattices (no fixed number of nodes or arcs).

The exact format of all the content lines is:


[lattice_format]
File: <fname> [btime] [etime] [ext_info] ...
Indicates the of a new lattice describing the audio signal <fname>[<btime>:<etime>].
O <node_nr> <iframe> [ext_info] ...
Open a new node with index <node_nr> at frame <iframe>. Frame indices are relative w.r.t. the start of the lattice. Node numbers are arbitrary numbers (do not have to be sequatial). After a close (see the 'C' command), a node number may be reused. All nodes except for the terminal nodes must have a zero or positive index. The indices (-1,-2,-3,-4) are reserver for the terminal nodes. Every search routine will try to end in a -1 terminal node, and will only back of a -2, -3, -4 (in that order) terminal node as a last option (e.g. the higher order nodes are not present or cannot be reached given the search constraints).
C <node_nr> [ext_info] ...
Close an open node. All nodes that were opened (even the terminal nodes) must be closed.
A <src_node_nr> <dst_node_nr> <isymbol> [score](0.0) [osymbol](-1) [ext_info] ...
An arc going from node <src_node_nr> to node <dst_node_nr> with a cost <score> while observing input symbol <isymb> and producing output symbol <osymb>. Both the input and output nodes must be open. Arcs must be topologically sorted, i.e. before any arc may leave a node, all incomming arcs must be handled (listed). Both the input and output symbol are number refering to some lexicon. A (-1) input symbol equals the '<s>' symbol. A (-1) (or '/') output symbols equals no output symbol (epsilon).
D <src_node_nr> <dst_node_nr> [score](0.0) [ext_info] ...
An epsilon arcs, i.e. an arc without input or output symbol.
%[comment] ...
Comments. Have no real function, except for providing some readable information (typically summary statistics). The processing modules copy, ignore or produce comment lines but they do not process the content.

The format of a lattice processing script is:

"[ROOT]"
  nr_outputs <nr>

"["name_of_the_operation"]"
  <IO_description>
  <module_specific_arguments>

...

The ROOT block will be replaced by the input stream.

The configuration of every block should start with a description of its inputs and optionally the name of the block (by default the name of the operation is taken as name of the processing block):


[IO_description]
INPUT[:port_nr_in](0) <src_module>[:port_nr_out](0)
Link the output from port <port_nr_out> of module <src_module> to input port number <port_nr_in> of this module. Input port 0 is handled automatically (linked to ouput port 0 of the previous module) if not defined.
NAME <module_name>
Give the module a name. By default the module type name (the strings between [...] hereunder) is used as name.

Date
January 2003
Author
Kris Demuynck