From eb08017561445d566b8c6c8558be18ff84038b42 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Wed, 18 Aug 2010 14:29:12 +0800 Subject: migrate export interpolation to use retrieve_all --- utils/storage/export_interpolation.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'utils/storage/export_interpolation.cpp') diff --git a/utils/storage/export_interpolation.cpp b/utils/storage/export_interpolation.cpp index 31dafb1..c0da280 100644 --- a/utils/storage/export_interpolation.cpp +++ b/utils/storage/export_interpolation.cpp @@ -101,15 +101,14 @@ void gen_bigram(FILE * output, FacadePhraseIndex * phrase_index, Bigram * bigram range.m_range_begin = token_min; range.m_range_end = token_max; - BigramPhraseArray array = g_array_new(FALSE, FALSE, sizeof(BigramPhraseItem)); - system->search(&range, array); + BigramPhraseWithCountArray array = g_array_new(FALSE, FALSE, sizeof(BigramPhraseItemWithCount)); + system->retrieve_all(array); for(int j = 0; j < array->len; j++) { - BigramPhraseItem * item = &g_array_index(array, BigramPhraseItem, j); + BigramPhraseItemWithCount * item = &g_array_index(array, BigramPhraseItemWithCount, j); char * word1 = token_to_string(phrase_index, token); char * word2 = token_to_string(phrase_index, item->m_token); - guint32 freq = 0; - assert(system->get_freq(item->m_token, freq)); + guint32 freq = item->m_count; if ( word1 && word2) fprintf(output, "\\item %s %s count %d\n", word1, word2, freq); -- cgit