diff options
author | Peng Wu <alexepico@gmail.com> | 2011-04-27 17:01:08 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2011-04-27 17:01:08 +0800 |
commit | 0b173665c29bd5a2d3b81625e7112cb503d357a9 (patch) | |
tree | 31e0aa7940f2ef17820ac63680af46cd8d44a955 /tests | |
parent | 844ff3da1745e9433f893390e85eb64c5c3fd5aa (diff) | |
download | libpinyin-0b173665c29bd5a2d3b81625e7112cb503d357a9.tar.gz libpinyin-0b173665c29bd5a2d3b81625e7112cb503d357a9.tar.xz libpinyin-0b173665c29bd5a2d3b81625e7112cb503d357a9.zip |
add remove method to flexible n-gram
Diffstat (limited to 'tests')
-rw-r--r-- | tests/storage/test_flexible_ngram.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tests/storage/test_flexible_ngram.cpp b/tests/storage/test_flexible_ngram.cpp index ea17adb..4e48715 100644 --- a/tests/storage/test_flexible_ngram.cpp +++ b/tests/storage/test_flexible_ngram.cpp @@ -61,7 +61,7 @@ int main(int argc, char * argv[]) { GArray * items = g_array_new(FALSE, FALSE, sizeof(phrase_token_t)); bigram.get_all_items(items); - printf("-----------------------train----------------------------\n"); + printf("-----------------------items----------------------------\n"); for ( size_t i = 0; i < items->len; ++i ){ phrase_token_t * token = &g_array_index(items, phrase_token_t, i); printf("item:%d\n", *token); @@ -101,6 +101,16 @@ int main(int argc, char * argv[]) { delete train_gram; } + assert(bigram.remove(1)); + + bigram.get_all_items(items); + printf("-----------------------items----------------------------\n"); + for ( size_t i = 0; i < items->len; ++i ){ + phrase_token_t * token = &g_array_index(items, phrase_token_t, i); + printf("item:%d\n", *token); + } + + g_array_free(items, TRUE); g_array_free(array, TRUE); return 0; } |