summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am2
-rw-r--r--src/storage/phrase_large_table3.cpp39
-rw-r--r--src/storage/phrase_large_table3.h4
3 files changed, 2 insertions, 43 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index a675bb1..b38a980 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -44,7 +44,7 @@ noinst_LTLIBRARIES = libpinyin_internal.la
libpinyin_la_SOURCES = pinyin.cpp
-libpinyin_la_LIBADD = storage/libstorage.la lookup/liblookup.la @GLIB2_LIBS@ @DATRIE_LIBS@
+libpinyin_la_LIBADD = storage/libstorage.la lookup/liblookup.la @GLIB2_LIBS@
libpinyin_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libpinyin.ver \
-version-info @LT_VERSION_INFO@
diff --git a/src/storage/phrase_large_table3.cpp b/src/storage/phrase_large_table3.cpp
index 4f9c692..12632ae 100644
--- a/src/storage/phrase_large_table3.cpp
+++ b/src/storage/phrase_large_table3.cpp
@@ -19,48 +19,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <datrie/trie.h>
#include "phrase_large_table3.h"
namespace pinyin{
-void PhraseLargeTable3::reset() {
- if (m_index) {
- trie_free(m_index);
- m_index = NULL;
- }
- if (m_content) {
- delete m_content;
- m_content = NULL;
- }
-}
-
-PhraseLargeTable3::PhraseLargeTable3() {
- AlphaMap * map = alpha_map_new();
- /* include ucs4 characters. */
- alpha_map_add_range(map, 1, UINT_MAX);
- m_index = trie_new(map);
- alpha_map_free(map);
-
- m_content = new MemoryChunk;
-}
-
-bool PhraseLargeTable3::load(FILE * index, MemoryChunk * content) {
- reset();
-
- m_index = trie_fread(index);
- if (NULL == m_index)
- return false;
- m_content = content;
- return true;
-}
-
-bool PhraseLargeTable3::store(FILE * new_index, MemoryChunk * new_content) {
- int retval = trie_fwrite(m_index, new_index);
- if (retval)
- return false;
- new_content->set_content(0, m_content->begin(), m_content->size());
- return true;
-}
/* load text method */
diff --git a/src/storage/phrase_large_table3.h b/src/storage/phrase_large_table3.h
index ab75c26..0a56753 100644
--- a/src/storage/phrase_large_table3.h
+++ b/src/storage/phrase_large_table3.h
@@ -26,14 +26,12 @@
#include "novel_types.h"
#include "memory_chunk.h"
-typedef struct _Trie Trie;
namespace pinyin{
class PhraseLargeTable3{
protected:
- Trie * m_index;
- MemoryChunk * m_content;
+ /* member variables. */
void reset();