summaryrefslogtreecommitdiffstats
path: root/src/storage/phrase_large_table3.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/storage/phrase_large_table3.cpp')
-rw-r--r--src/storage/phrase_large_table3.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/storage/phrase_large_table3.cpp b/src/storage/phrase_large_table3.cpp
index 12632ae..07c5e70 100644
--- a/src/storage/phrase_large_table3.cpp
+++ b/src/storage/phrase_large_table3.cpp
@@ -23,6 +23,35 @@
namespace pinyin{
+/**
+ * Data Structure:
+ * m_chunk consists of table entry header and array of tokens.
+ */
+
+class PhraseTableEntry{
+ friend class PhraseLargeTable3;
+protected:
+ MemoryChunk m_chunk;
+
+private:
+ /* Disallow used outside. */
+ PhraseTableEntry() {}
+
+public:
+ /* search method */
+ int search(/* in */ const ucs4_t phrase[], /* out */ PhraseTokens tokens) const;
+
+ /* add_index/remove_index method */
+ int add_index(/* in */ const ucs4_t phrase[], /* in */ phrase_token_t token);
+ int remove_index(/* in */ const ucs4_t phrase[], /* in */ phrase_token_t token);
+
+ /* get length method */
+ int get_length() const;
+
+ /* mask out method */
+ bool mask_out(phrase_token_t mask, phrase_token_t value);
+};
+
/* load text method */
bool PhraseLargeTable3::load_text(FILE * infile){