diff --git a/scim-wnn/src/romkan.cpp b/scim-wnn/src/romkan.cpp index a5c3df6..87acb56 100644 --- a/scim-wnn/src/romkan.cpp +++ b/scim-wnn/src/romkan.cpp @@ -18,7 +18,6 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #include "romkan.h" -#include "romkan_table.h" #include "scim_wnn_def.h" #ifdef HAVE_CONFIG_H @@ -59,7 +58,16 @@ void Romkan::loadTable(const String &filename, bool inc) { FILE *f = fopen(filename.c_str(),"r"); - if (!f) return; + if (!f) { + #ifdef SCIM_WNN_DATADIR + String fn = SCIM_WNN_DATADIR; + fn += "/" + filename; + f = fopen(fn.c_str(),"r"); + if (!f) return; + #else + return; + #endif + } while(-1) { char s[256]; @@ -140,22 +148,6 @@ if (rk_table.size()) { loadTable(rk_table); - } else { - unsigned int i = 0; - while(strcmp(_RomkanTable[i],"") != 0) { - WideString w; - String s = _RomkanTable[i]; - iconvert.convert(w,String(_RomkanTable[i + 1])); - RomkanTable.insert(pair(s,w)); - - for(unsigned int j = s.length();j > 1;j --) { - String k = s.substr(0,j - 1); - if ((keepTable.find(k) == keepTable.end()) && (RomkanTable.find(k) == RomkanTable.end())) { - keepTable.insert(k); - } - } - i += 2; - } } if (tableConfig.find("nnMode") != tableConfig.end()) diff --git a/scim-wnn/src/scim_wnn_def.h b/scim-wnn/src/scim_wnn_def.h index b8adc8a..675857f 100644 --- a/scim-wnn/src/scim_wnn_def.h +++ b/scim-wnn/src/scim_wnn_def.h @@ -111,15 +111,8 @@ // Romkan -#define SCIM_CONFIG_WNN_ROMKAN_PREFIX "/IMEngine/Wnn/Romkan/" -#define SCIM_CONFIG_WNN_ROMKAN_NNMODE "/IMEngine/Wnn/Romkan/nnMode" -#define SCIM_DEFAULT_WNN_ROMKAN_NNMODE false #define SCIM_CONFIG_WNN_ROMKAN_TABLE_FILE "/IMEngine/Wnn/Romkan/TableFile" -#define SCIM_DEFAULT_WNN_ROMKAN_TABLE_FILE "" -#define SCIM_CONFIG_WNN_KEY_ROMKAN_ASCIIMODE "/IMEngine/Wnn/Romkan/Key/Ascii" -#define SCIM_DEFAULT_WNN_KEY_ROMKAN_ASCIIMODE "q" -#define SCIM_CONFIG_WNN_KEY_ROMKAN_WASCIIMODE "/IMEngine/Wnn/Romkan/Key/WideAscii" -#define SCIM_DEFAULT_WNN_KEY_ROMKAN_WASCIIMODE "Shift+Q" +#define SCIM_DEFAULT_WNN_ROMKAN_TABLE_FILE "scim-wnn-def.rkt"