Logo Search packages:      
Sourcecode: yaskkserv version File versions  Download package

static bool SkkJisyo::createDictionaryForClassSkkJisyo ( const char *  filename_source,
const char *  filename_destination 
) [inline, static]

SKK 辞書を class SkkJisyo 形式の辞書へ変換します。変換に失敗した場合は偽を返します。.

class SkkJisyo で扱う形式の辞書にはインデックスデータが存在しません。

Definition at line 2044 of file skk_jisyo.hpp.

References create_dictionary_for_class_skk_jisyo(), and get_index().

Referenced by createDictionaryForClassSkkDictionary().

        {
                DEBUG_ASSERT_POINTER(filename_source);
                DEBUG_ASSERT_POINTER(filename_destination);

                bool result = true;
                SkkMmap mmap;
                char *buffer = static_cast<char*>(mmap.map(filename_source));

                if (buffer == 0)
                {
                        result = false;
                }
                else
                {
                        int filesize = mmap.getFilesize();
                        if (filesize < SkkUtility::getStringOkuriAriLength() + SkkUtility::getStringOkuriNasiLength())
                        {
                                result = false;
                        }
                        else
                        {
                                int okuri_ari_index = 0;
                                int okuri_nasi_index = 0;

// まず okuri_ari_index と okuri_nasi_index を求めます。
                                if (!get_index(buffer,
                                               filesize,
                                               okuri_ari_index,
                                               okuri_nasi_index))
                                {
                                        result = false;
                                }
                                else
                                {
                                        result = create_dictionary_for_class_skk_jisyo(filename_destination,
                                                                                       buffer,
                                                                                       filesize,
                                                                                       okuri_ari_index,
                                                                                       okuri_nasi_index);
                                }
                        }
                }

                return result;
        }


Generated by  Doxygen 1.6.0   Back to index