summaryrefslogtreecommitdiffstats
path: root/src/storage/ngram.h
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2012-03-16 11:08:54 +0800
committerPeng Wu <alexepico@gmail.com>2012-03-16 11:08:54 +0800
commita39b327648641d0b723f9a70e73d9c4efc7913a4 (patch)
treef58f2852072bf4491cc6554edbf49a13543157b0 /src/storage/ngram.h
parent8723118e91ccacda4bb3b55fba5eeaa5cbe2eff6 (diff)
downloadlibpinyin-a39b327648641d0b723f9a70e73d9c4efc7913a4.tar.gz
libpinyin-a39b327648641d0b723f9a70e73d9c4efc7913a4.tar.xz
libpinyin-a39b327648641d0b723f9a70e73d9c4efc7913a4.zip
update comments
Diffstat (limited to 'src/storage/ngram.h')
-rw-r--r--src/storage/ngram.h17
1 files changed, 8 insertions, 9 deletions
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);