summaryrefslogtreecommitdiffstats
path: root/src/storage
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
parent8723118e91ccacda4bb3b55fba5eeaa5cbe2eff6 (diff)
downloadlibpinyin-a39b327648641d0b723f9a70e73d9c4efc7913a4.tar.gz
libpinyin-a39b327648641d0b723f9a70e73d9c4efc7913a4.tar.xz
libpinyin-a39b327648641d0b723f9a70e73d9c4efc7913a4.zip
update comments
Diffstat (limited to 'src/storage')
-rw-r--r--src/storage/flexible_ngram.h8
-rw-r--r--src/storage/ngram.cpp3
-rw-r--r--src/storage/ngram.h17
3 files changed, 12 insertions, 16 deletions
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);