summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPeng Wu <alexepico@gmail.com>2017-01-03 14:31:44 +0800
committerPeng Wu <alexepico@gmail.com>2017-01-03 14:34:36 +0800
commit23e3d03c75d21d16047023ed34a8a373385237f4 (patch)
tree8ab970a4747e6ce98ea08c363cf353c46152eae6 /src
parent69e9e0b83e7a9aeb678dd7f564561541be7225ee (diff)
downloadlibpinyin-23e3d03c75d21d16047023ed34a8a373385237f4.tar.gz
libpinyin-23e3d03c75d21d16047023ed34a8a373385237f4.tar.xz
libpinyin-23e3d03c75d21d16047023ed34a8a373385237f4.zip
add variables
Diffstat (limited to 'src')
-rw-r--r--src/lookup/phonetic_lookup.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/lookup/phonetic_lookup.h b/src/lookup/phonetic_lookup.h
index 4061195..c8f3a30 100644
--- a/src/lookup/phonetic_lookup.h
+++ b/src/lookup/phonetic_lookup.h
@@ -65,12 +65,44 @@ public:
};
struct trellis_constraint_t {
+ /* the constraint type */
constraint_type m_type;
// expand the previous union into struct to catch some errors.
+ /* the token of the word */
phrase_token_t m_token;
+ /* for CONSTRAINT_ONESTEP type:
+ the index of the next word.
+ for CONSTRAINT_NOSEARCH type:
+ the index of the previous onestep constraint. */
guint32 m_constraint_step;
};
+typedef phrase_token_t lookup_key_t;
+/* Key: lookup_key_t, Value: int m, index to m_steps_content[i][m] */
+typedef GHashTable * LookupStepIndex;
+ /* Array of trellis_node */
+typedef GArray * LookupStepContent;
+
+class ForwardPhoneticTrellis {
+private:
+ /* Array of LookupStepIndex */
+ GPtrArray * m_steps_index;
+ /* Array of LookupStepContent */
+ GPtrArray * m_steps_content;
+
+};
+
+class BackwardPhoneticMatrix {
+private:
+ /* Array of matrix_step */
+ GArray * m_steps_matrix;
+};
+
+class ForwardPhoneticConstraints {
+private:
+ /* Array of trellis_constraint_t */
+ GArray * m_constraints;
+};
};