44#include "ngram_model_internal.h"
45#include "lm_trie_quant.h"
81 size_t ngram_mem_size;
83 middle_t *middle_begin;
86 lm_trie_quant_t *quant;
88 float backoff_cache[NGRAM_MAX_ORDER];
89 uint32 hist_cache[NGRAM_MAX_ORDER - 1];
95lm_trie_t *lm_trie_create(uint32 unigram_count,
int order);
97lm_trie_t *lm_trie_read_bin(uint32 * counts,
int order, FILE * fp);
99void lm_trie_write_bin(lm_trie_t * trie, uint32 unigram_count, FILE * fp);
101void lm_trie_free(lm_trie_t * trie);
103void lm_trie_build(lm_trie_t * trie, ngram_raw_t ** raw_ngrams,
104 uint32 * counts, uint32 *out_counts,
int order);
106void lm_trie_fill_raw_ngram(lm_trie_t * trie,
107 ngram_raw_t * raw_ngrams, uint32 * raw_ngram_idx,
108 uint32 * counts, node_range_t range, uint32 * hist,
109 int n_hist,
int order,
int max_order);
111float lm_trie_score(lm_trie_t * trie,
int order, int32 wid, int32 * hist,
112 int32 n_hist, int32 * n_used);
An implementation bit array - memory efficient storage for digit int and float data.
struct bitarr_mask_s bitarr_mask_t
Structure that specifies bits required to efficiently store certain data.
file IO related operations.