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

static bool SkkJisyo::create_dictionary_for_class_skk_jisyo ( const char *  filename_destination,
const char *  buffer,
int  filesize,
int  okuri_ari_index,
int  okuri_nasi_index 
) [inline, static, private]

コメントを削除し「送りあり」と「送りなし」を混ぜてソート済みの状態で 出力します。但し、「送りなし」の「ひらがな(0xa4)」と「ASCII(0x21 - 0x7e)」以外の文字は special_okuri_nasi_buffer へ格納し、最後に出力し ます。

;; okuri-ari entries. いろは /.../ いろはa /.../ いろはa /.../ にほへとa /.../ → にほへと /.../ ;; okuri-nasi entries. にほへとa /.../ いろは /.../ special_okuri_nasi_buffer にほへと /.../ 2しんほう /2進法/ 2しんほう /2進法/ イ /ヰ/ イ /ヰ/

Definition at line 1242 of file skk_jisyo.hpp.

Referenced by createDictionaryForClassSkkJisyo().

        {
                DEBUG_ASSERT_POINTER(filename_destination);
                DEBUG_ASSERT_POINTER(buffer);
                DEBUG_ASSERT(filesize > 0);
                DEBUG_ASSERT(okuri_ari_index >= 0);
                DEBUG_ASSERT(okuri_nasi_index >= 0);

                char tmp_filename_normal[] = "/tmp/skkjisyo_normal.XXXXXX";
                char tmp_filename_special[] = "/tmp/skkjisyo_special.XXXXXX";

                int normal_fd = mkstemp(tmp_filename_normal);
                if (normal_fd == -1)
                {
                        return false;
                }

                int special_fd = mkstemp(tmp_filename_special);
                if (special_fd == -1)
                {
                        return false;
                }

                bool result;
                int okuri_ari_lines = 0;
                int okuri_nasi_lines = 0;
                int special_okuri_nasi_lines = 0;

                result = create_dictionary_for_class_skk_jisyo_write_temporary(buffer,
                                                                               filesize,
                                                                               normal_fd,
                                                                               special_fd,
                                                                               okuri_ari_index,
                                                                               okuri_nasi_index,
                                                                               okuri_ari_lines,
                                                                               okuri_nasi_lines,
                                                                               special_okuri_nasi_lines);

                if (result)
                {
                        result = create_dictionary_for_class_skk_jisyo_sort_and_write(filename_destination,
                                                                                      tmp_filename_normal,
                                                                                      tmp_filename_special,
                                                                                      okuri_ari_lines,
                                                                                      okuri_nasi_lines,
                                                                                      special_okuri_nasi_lines);
                }

                if (unlink(tmp_filename_normal) == -1)
                {
                        result = false;
                }
                if (unlink(tmp_filename_special) == -1)
                {
                        result = false;
                }

                return result;
        }


Generated by  Doxygen 1.6.0   Back to index