3 * Library to deal with pinyin.
5 * Copyright (C) 2013 Peng Wu <alexepico@gmail.com>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
25 #include "novel_types.h"
31 NOT_USED, /* not used. */
32 SYSTEM_FILE, /* system phrase file. */
33 DICTIONARY, /* professional dictionary. */
34 USER_FILE, /* user only phrase file. */
38 guint8 m_dict_index; /* for assert purpose. */
39 const gchar * m_table_filename;
40 const gchar * m_system_filename;
41 const gchar * m_user_filename;
42 PHRASE_FILE_TYPE m_file_type;
43 } pinyin_table_info_t;
48 class SystemTableInfo{
49 friend class UserTableInfo;
51 int m_binary_format_version;
52 int m_model_data_version;
55 pinyin_table_info_t m_table_info[PHRASE_INDEX_LIBRARY_COUNT];
60 void postfix_tables();
67 bool load(const char * filename);
69 const pinyin_table_info_t * get_table_info();
76 int m_binary_format_version;
77 int m_model_data_version;
85 bool load(const char * filename);
87 bool save(const char * filename);
89 bool is_conform(const SystemTableInfo * sysinfo);
91 bool make_conform(const SystemTableInfo * sysinfo);