diff options
author | Peng Wu <alexepico@gmail.com> | 2017-01-03 14:31:44 +0800 |
---|---|---|
committer | Peng Wu <alexepico@gmail.com> | 2017-01-03 14:34:36 +0800 |
commit | 23e3d03c75d21d16047023ed34a8a373385237f4 (patch) | |
tree | 8ab970a4747e6ce98ea08c363cf353c46152eae6 /src/lookup/phonetic_lookup.h | |
parent | 69e9e0b83e7a9aeb678dd7f564561541be7225ee (diff) | |
download | libpinyin-23e3d03c75d21d16047023ed34a8a373385237f4.tar.gz libpinyin-23e3d03c75d21d16047023ed34a8a373385237f4.tar.xz libpinyin-23e3d03c75d21d16047023ed34a8a373385237f4.zip |
add variables
Diffstat (limited to 'src/lookup/phonetic_lookup.h')
-rw-r--r-- | src/lookup/phonetic_lookup.h | 32 |
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; +}; }; |