From a39b327648641d0b723f9a70e73d9c4efc7913a4 Mon Sep 17 00:00:00 2001 From: Peng Wu Date: Fri, 16 Mar 2012 11:08:54 +0800 Subject: update comments --- src/storage/flexible_ngram.h | 8 ++++---- src/storage/ngram.cpp | 3 --- src/storage/ngram.h | 17 ++++++++--------- 3 files changed, 12 insertions(+), 16 deletions(-) (limited to 'src/storage') diff --git a/src/storage/flexible_ngram.h b/src/storage/flexible_ngram.h index dda0552..db4436f 100644 --- a/src/storage/flexible_ngram.h +++ b/src/storage/flexible_ngram.h @@ -329,9 +329,9 @@ public: /** * FlexibleBigram: - * @MagicHeader: the type of the magic header. - * @ArrayHeader: the type of the array header. - * @ArrayItem: the type of the array item. + * @MagicHeader: the struct type of the magic header. + * @ArrayHeader: the struct type of the array header. + * @ArrayItem: the struct type of the array item. * * The flexible bi-gram is mainly used for training purpose. * @@ -358,7 +358,7 @@ private: public: /** * FlexibleBigram::FlexibleBigram: - * @magic_number: the 4 bytes magic number of the bi-gram. + * @magic_number: the 4 bytes magic number of the flexible bi-gram. * * The constructor of the FlexibleBigram. * diff --git a/src/storage/ngram.cpp b/src/storage/ngram.cpp index dbb9267..a15ed32 100644 --- a/src/storage/ngram.cpp +++ b/src/storage/ngram.cpp @@ -410,9 +410,6 @@ bool Bigram::get_all_items(GArray * items){ namespace pinyin{ /* merge origin system info and delta user info */ -/* Note: Please keep system and user single gram - * when using merged single gram. - */ bool merge_single_gram(SingleGram * merged, const SingleGram * system, const SingleGram * user){ if (NULL == system && NULL == user) diff --git a/src/storage/ngram.h b/src/storage/ngram.h index 73e422a..dfc9f25 100644 --- a/src/storage/ngram.h +++ b/src/storage/ngram.h @@ -28,15 +28,11 @@ namespace pinyin{ class Bigram; -/* Note: - * When transfer from system ngram to user ngram, - * if user ngram doesn't exist, - * copy total freq from system ngram to user ngram, - * so the total freq exists. - * if item freq don't exist, copy item freq from system to user ngram, - * so the item freq exists. - * if user ngram already exists(always true), increases the total freq, - * if item ngram already exists(always true), increases the freq. +/** Note: + * The system single gram contains the trained freqs. + * The user single gram contains the delta freqs. + * During the Viterbi beam search, use merge_single_gram to merge the system + * single gram and the user single gram. */ class SingleGram{ @@ -134,6 +130,9 @@ public: bool get_all_items(/* out */ GArray * items); }; +/* Note: Please keep system and user single gram + * when using merged single gram. + */ bool merge_single_gram(SingleGram * merged, const SingleGram * system, const SingleGram * user); -- cgit