Lines Matching refs:fp
160 bool NGram::save_ngram(FILE *fp) {
161 if (!initialized_ || NULL == fp)
167 if (fwrite(&idx_num_, sizeof(size_t), 1, fp) != 1)
170 if (fwrite(freq_codes_, sizeof(LmaScoreType), kCodeBookSize, fp) !=
174 if (fwrite(lma_freq_idx_, sizeof(CODEBOOK_TYPE), idx_num_, fp) != idx_num_)
180 bool NGram::load_ngram(FILE *fp) {
181 if (NULL == fp)
186 if (fread(&idx_num_, sizeof(size_t), 1, fp) != 1 )
203 if (fread(freq_codes_, sizeof(LmaScoreType), kCodeBookSize, fp) !=
207 if (fread(lma_freq_idx_, sizeof(CODEBOOK_TYPE), idx_num_, fp) != idx_num_)