#include <sys/types.h>
#include <stdio.h>
#include "general.h"
Go to the source code of this file.
Compounds | |
struct | sih_slot_t |
one slot of string to integer table More... | |
struct | sih_t |
string to integer table More... | |
Functions | |
sih_t * | sih_create (int initial_size, double max_occupancy, double growth_ratio, int warn_on_update) |
void | sih_add (sih_t *ht, char *string, int32 intval) |
char | sih_lookup (sih_t *ht, char *string, int32 *p_intval) |
void * | sih_val_write_to_file (sih_t *ht, FILE *fp, char *filename, int verbosity) |
void * | sih_val_read_from_file (sih_t *ht, FILE *fp, char *filename, int verbosity) |
void | get_vocab_from_vocab_ht (sih_t *ht, int vocab_size, int verbosity, char ***p_vocab) |
void | read_wlist_into_siht (char *wlist_filename, int verbosity, sih_t *p_word_id_ht, int *p_n_wlist) |
void | read_wlist_into_array (char *wlist_filename, int verbosity, char ***p_wlist, int *p_n_wlist) |
Definition in file sih.h.
|
derive the vocab from the vocab hash table Definition at line 74 of file read_voc.c. References fprintf(), sih_slot_t::intval, sih_t::nslots, quit(), rr_malloc(), sih_t::slots, sih_slot_t::string, and verbosity. Referenced by load_lm(), and read_voc(). |
|
Referenced by read_voc(). |
|
read_wlist_into_siht: read a word list into a string-to-int32 hash table
Definition at line 28 of file read_wlist_si.c. References fprintf(), p_n_wlist, rr_iclose(), rr_iopen(), salloc(), sih_add(), and verbosity. Referenced by read_voc(). |
|
Add an entry to hash
Definition at line 91 of file sih.c. References fprintf(), free(), sih_t::growth_ratio, int32, sih_slot_t::intval, intval, sih_t::max_occupancy, nearest_prime_up(), sih_t::nentries, sih_t::nslots, quit(), rr_calloc(), SIH_KEY, sih_t::slots, sih_slot_t::string, and sih_t::warn_on_update. Referenced by load_arpa_lm(), and read_wlist_into_siht(). |
|
Create a string to integer hash
Definition at line 69 of file sih.c. References sih_t::growth_ratio, MAX, sih_t::max_occupancy, nearest_prime_up(), sih_t::nentries, sih_t::nslots, quit(), rr_calloc(), rr_malloc(), sih_t::slots, and sih_t::warn_on_update. Referenced by load_arpa_lm(), and main(). |
|
Lookup the hash table
Definition at line 145 of file sih.c. References int32, sih_slot_t::intval, sih_t::nslots, quit(), SIH_KEY, sih_t::slots, and sih_slot_t::string. Referenced by compute_perplexity(), gen_fb_list(), load_arpa_lm(), main(), and validate(). |
|
Read the value from a file to a hash
Definition at line 227 of file sih.c. References fprintf(), sih_t::growth_ratio, HASH_VERSION, int32, sih_slot_t::intval, sih_t::max_occupancy, sih_t::nentries, sih_t::nslots, quit(), rr_calloc(), rr_fread(), rr_malloc(), sih_t::slots, sih_slot_t::string, verbosity, and sih_t::warn_on_update. Referenced by load_lm(), and read_voc(). |
|
Read/Write from/to a file an (almost) ready-to-use hash table. The hash-table is a string->int mapping. All intvals are written out, whether or not they belong to active entries. All strings are writen out too, where an empty entry is represented in the file as a null string (null strings as entries are not allowed).
Definition at line 181 of file sih.c. References fprintf(), sih_t::growth_ratio, HASH_VERSION, int32, sih_slot_t::intval, sih_t::max_occupancy, sih_t::nentries, sih_t::nslots, quit(), rr_fwrite(), sih_t::slots, sih_slot_t::string, verbosity, and sih_t::warn_on_update. Referenced by write_bin_lm(). |