/* rom-kana-utils.c generated by valac 0.56.19, the Vala compiler
 * generated from rom-kana-utils.vala, do not modify */

/*
 * Copyright (C) 2011-2014 Daiki Ueno <ueno@gnu.org>
 * Copyright (C) 2011-2014 Red Hat, Inc.
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

#include <glib-object.h>
#include <glib.h>
#include <stdlib.h>
#include <string.h>
#include <gee.h>
#include "libkkc/libkkc.h"

#if !defined(VALA_STRICT_C)
#if !defined(__clang__) && defined(__GNUC__) && (__GNUC__ >= 14)
#pragma GCC diagnostic warning "-Wincompatible-pointer-types"
#elif defined(__clang__) && (__clang_major__ >= 16)
#pragma clang diagnostic ignored "-Wincompatible-function-pointer-types"
#pragma clang diagnostic ignored "-Wincompatible-pointer-types"
#endif
#endif

typedef enum  {
	KKC_NUMERIC_CONVERSION_TYPE_LATIN,
	KKC_NUMERIC_CONVERSION_TYPE_WIDE_LATIN,
	KKC_NUMERIC_CONVERSION_TYPE_KANJI_NUMERAL,
	KKC_NUMERIC_CONVERSION_TYPE_KANJI,
	KKC_NUMERIC_CONVERSION_TYPE_RECONVERT,
	KKC_NUMERIC_CONVERSION_TYPE_DAIJI,
	KKC_NUMERIC_CONVERSION_TYPE_RESERVED6,
	KKC_NUMERIC_CONVERSION_TYPE_RESERVED7,
	KKC_NUMERIC_CONVERSION_TYPE_GROUPING,
	KKC_NUMERIC_CONVERSION_TYPE_SHOGI
} KkcNumericConversionType;

#define KKC_TYPE_NUMERIC_CONVERSION_TYPE (kkc_numeric_conversion_type_get_type ())

#define KKC_TYPE_ROM_KANA_UTILS (kkc_rom_kana_utils_get_type ())
#define KKC_ROM_KANA_UTILS(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), KKC_TYPE_ROM_KANA_UTILS, KkcRomKanaUtils))
#define KKC_ROM_KANA_UTILS_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), KKC_TYPE_ROM_KANA_UTILS, KkcRomKanaUtilsClass))
#define KKC_IS_ROM_KANA_UTILS(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), KKC_TYPE_ROM_KANA_UTILS))
#define KKC_IS_ROM_KANA_UTILS_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), KKC_TYPE_ROM_KANA_UTILS))
#define KKC_ROM_KANA_UTILS_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), KKC_TYPE_ROM_KANA_UTILS, KkcRomKanaUtilsClass))

typedef struct _KkcRomKanaUtils KkcRomKanaUtils;
typedef struct _KkcRomKanaUtilsClass KkcRomKanaUtilsClass;
typedef struct _KkcRomKanaUtilsPrivate KkcRomKanaUtilsPrivate;
enum  {
	KKC_ROM_KANA_UTILS_0_PROPERTY,
	KKC_ROM_KANA_UTILS_NUM_PROPERTIES
};
static GParamSpec* kkc_rom_kana_utils_properties[KKC_ROM_KANA_UTILS_NUM_PROPERTIES];

#define KKC_ROM_KANA_UTILS_TYPE_KANA_TABLE_ENTRY (kkc_rom_kana_utils_kana_table_entry_get_type ())
typedef struct _KkcRomKanaUtilsKanaTableEntry KkcRomKanaUtilsKanaTableEntry;
#define _g_string_free0(var) ((var == NULL) ? NULL : (var = (g_string_free (var, TRUE), NULL)))
#define _g_free0(var) (var = (g_free (var), NULL))
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
typedef struct _Block1Data Block1Data;
typedef struct _Block2Data Block2Data;
typedef struct _Block3Data Block3Data;

struct _KkcRomKanaUtils {
	GObject parent_instance;
	KkcRomKanaUtilsPrivate * priv;
};

struct _KkcRomKanaUtilsClass {
	GObjectClass parent_class;
};

struct _KkcRomKanaUtilsKanaTableEntry {
	gunichar katakana;
	gchar* hiragana;
	gchar* hankaku_katakana;
};

struct _Block1Data {
	int _ref_count_;
	GString* builder;
};

struct _Block2Data {
	int _ref_count_;
	GString* builder;
};

struct _Block3Data {
	int _ref_count_;
	GString* builder;
};

static gpointer kkc_rom_kana_utils_parent_class = NULL;
static GeeMap* kkc_rom_kana_utils__HiraganaTable;
static GeeMap* kkc_rom_kana_utils__HiraganaTable = NULL;
static GeeMap* kkc_rom_kana_utils__KatakanaTable;
static GeeMap* kkc_rom_kana_utils__KatakanaTable = NULL;
static GeeMap* kkc_rom_kana_utils__HankakuKatakanaTable;
static GeeMap* kkc_rom_kana_utils__HankakuKatakanaTable = NULL;
static GeeMap* kkc_rom_kana_utils__CompositionTable;
static GeeMap* kkc_rom_kana_utils__CompositionTable = NULL;
static GeeMap* kkc_rom_kana_utils__WideLatinToLatinTable;
static GeeMap* kkc_rom_kana_utils__WideLatinToLatinTable = NULL;

VALA_EXTERN GType kkc_numeric_conversion_type_get_type (void) G_GNUC_CONST ;
VALA_EXTERN GType kkc_rom_kana_utils_get_type (void) G_GNUC_CONST ;
static GType kkc_rom_kana_utils_kana_table_entry_get_type (void) G_GNUC_CONST  G_GNUC_UNUSED ;
static KkcRomKanaUtilsKanaTableEntry* kkc_rom_kana_utils_kana_table_entry_dup (const KkcRomKanaUtilsKanaTableEntry* self);
static void kkc_rom_kana_utils_kana_table_entry_free (KkcRomKanaUtilsKanaTableEntry* self);
static void kkc_rom_kana_utils_kana_table_entry_copy (const KkcRomKanaUtilsKanaTableEntry* self,
                                               KkcRomKanaUtilsKanaTableEntry* dest);
static void kkc_rom_kana_utils_kana_table_entry_destroy (KkcRomKanaUtilsKanaTableEntry* self);
static gchar* kkc_rom_kana_utils_get_okurigana_prefix_for_char (gunichar uc);
VALA_EXTERN gchar* kkc_rom_kana_utils_get_okurigana_prefix (const gchar* okurigana);
VALA_EXTERN gunichar kkc_rom_kana_utils_get_wide_latin_char (gunichar uc);
VALA_EXTERN gchar* kkc_rom_kana_utils_get_wide_latin (const gchar* latin);
VALA_EXTERN gchar* kkc_rom_kana_utils_get_latin (const gchar* wide_latin);
VALA_EXTERN gchar* kkc_rom_kana_utils_normalize (const gchar* input);
VALA_EXTERN gchar* kkc_rom_kana_utils_get_hiragana (const gchar* kana);
static gunichar kkc_rom_kana_utils_get_katakana_char (gunichar uc);
static void kkc_rom_kana_utils_foreach_katakana (const gchar* kana,
                                          GFunc func,
                                          gpointer func_target);
VALA_EXTERN gchar* kkc_rom_kana_utils_get_katakana (const gchar* kana);
static Block1Data* block1_data_ref (Block1Data* _data1_);
static void block1_data_unref (void * _userdata_);
static void __lambda7_ (Block1Data* _data1_,
                 gunichar uc);
static void ___lambda7__gfunc (gconstpointer data,
                        gpointer self);
static Block2Data* block2_data_ref (Block2Data* _data2_);
static void block2_data_unref (void * _userdata_);
static void __lambda6_ (Block2Data* _data2_,
                 gunichar uc);
static void ___lambda6__gfunc (gconstpointer data,
                        gpointer self);
VALA_EXTERN gchar* kkc_rom_kana_utils_get_hankaku_katakana (const gchar* kana);
static Block3Data* block3_data_ref (Block3Data* _data3_);
static void block3_data_unref (void * _userdata_);
static void __lambda8_ (Block3Data* _data3_,
                 gunichar uc);
static void ___lambda8__gfunc (gconstpointer data,
                        gpointer self);
VALA_EXTERN gchar* kkc_rom_kana_utils_convert_by_kana_mode (const gchar* str,
                                                KkcKanaMode mode);
static gchar* kkc_rom_kana_utils_get_kanji_numeric (gint numeric,
                                             gchar** num_table,
                                             gint num_table_length1,
                                             gchar** num_pos_table,
                                             gint num_pos_table_length1);
VALA_EXTERN gchar* kkc_rom_kana_utils_get_numeric (gint numeric,
                                       KkcNumericConversionType type);
static void _vala_array_add3 (gchar** * array,
                       gint* length,
                       gint* size,
                       gchar* value);
static void _vala_array_add4 (gchar** * array,
                       gint* length,
                       gint* size,
                       gchar* value);
VALA_EXTERN gboolean kkc_rom_kana_utils_is_katakana (const gchar* str);
VALA_EXTERN gboolean kkc_rom_kana_utils_is_hiragana (const gchar* str);
VALA_EXTERN KkcRomKanaUtils* kkc_rom_kana_utils_construct (GType object_type);
static void kkc_rom_kana_utils_finalize (GObject * obj);
static GType kkc_rom_kana_utils_get_type_once (void);
static void _vala_array_destroy (gpointer array,
                          gssize array_length,
                          GDestroyNotify destroy_func);
static void _vala_array_free (gpointer array,
                       gssize array_length,
                       GDestroyNotify destroy_func);

static const KkcRomKanaUtilsKanaTableEntry KKC_ROM_KANA_UTILS_KanaTable[92] = {{12450U, "あ", "ｱ"}, {12452U, "い", "ｲ"}, {12454U, "う", "ｳ"}, {12456U, "え", "ｴ"}, {12458U, "お", "ｵ"}, {12459U, "か", "ｶ"}, {12461U, "き", "ｷ"}, {12463U, "く", "ｸ"}, {12465U, "け", "ｹ"}, {12467U, "こ", "ｺ"}, {12469U, "さ", "ｻ"}, {12471U, "し", "ｼ"}, {12473U, "す", "ｽ"}, {12475U, "せ", "ｾ"}, {12477U, "そ", "ｿ"}, {12479U, "た", "ﾀ"}, {12481U, "ち", "ﾁ"}, {12484U, "つ", "ﾂ"}, {12486U, "て", "ﾃ"}, {12488U, "と", "ﾄ"}, {12490U, "な", "ﾅ"}, {12491U, "に", "ﾆ"}, {12492U, "ぬ", "ﾇ"}, {12493U, "ね", "ﾈ"}, {12494U, "の", "ﾉ"}, {12495U, "は", "ﾊ"}, {12498U, "ひ", "ﾋ"}, {12501U, "ふ", "ﾌ"}, {12504U, "へ", "ﾍ"}, {12507U, "ほ", "ﾎ"}, {12510U, "ま", "ﾏ"}, {12511U, "み", "ﾐ"}, {12512U, "む", "ﾑ"}, {12513U, "め", "ﾒ"}, {12514U, "も", "ﾓ"}, {12516U, "や", "ﾔ"}, {12518U, "ゆ", "ﾕ"}, {12520U, "よ", "ﾖ"}, {12521U, "ら", "ﾗ"}, {12522U, "り", "ﾘ"}, {12523U, "る", "ﾙ"}, {12524U, "れ", "ﾚ"}, {12525U, "ろ", "ﾛ"}, {12527U, "わ", "ﾜ"}, {12528U, "ゐ", "ｲ"}, {12529U, "ゑ", "ｴ"}, {12530U, "を", "ｦ"}, {12531U, "ん", "ﾝ"}, {12460U, "が", "ｶﾞ"}, {12462U, "ぎ", "ｷﾞ"}, {12464U, "ぐ", "ｸﾞ"}, {12466U, "げ", "ｹﾞ"}, {12468U, "ご", "ｺﾞ"}, {12470U, "ざ", "ｻﾞ"}, {12472U, "じ", "ｼﾞ"}, {12474U, "ず", "ｽﾞ"}, {12476U, "ぜ", "ｾﾞ"}, {12478U, "ぞ", "ｿﾞ"}, {12480U, "だ", "ﾀﾞ"}, {12482U, "ぢ", "ﾁﾞ"}, {12485U, "づ", "ﾂﾞ"}, {12487U, "で", "ﾃﾞ"}, {12489U, "ど", "ﾄﾞ"}, {12496U, "ば", "ﾊﾞ"}, {12499U, "び", "ﾋﾞ"}, {12502U, "ぶ", "ﾌﾞ"}, {12505U, "べ", "ﾍﾞ"}, {12508U, "ぼ", "ﾎﾞ"}, {12497U, "ぱ", "ﾊﾟ"}, {12500U, "ぴ", "ﾋﾟ"}, {12503U, "ぷ", "ﾌﾟ"}, {12506U, "ぺ", "ﾍﾟ"}, {12509U, "ぽ", "ﾎﾟ"}, {12449U, "ぁ", "ｧ"}, {12451U, "ぃ", "ｨ"}, {12453U, "ぅ", "ｩ"}, {12455U, "ぇ", "ｪ"}, {12457U, "ぉ", "ｫ"}, {12483U, "っ", "ｯ"}, {12515U, "ゃ", "ｬ"}, {12517U, "ゅ", "ｭ"}, {12519U, "ょ", "ｮ"}, {12526U, "ゎ", NULL}, {12532U, "う゛", "ｳﾞ"}, {12533U, NULL, NULL}, {12534U, NULL, NULL}, {12290U, "。", "｡"}, {12300U, "「", "｢"}, {12301U, "」", "｣"}, {12289U, "、", "､"}, {12539U, "・", "･"}, {12540U, "ー", "ｰ"}};
static const KkcRomKanaUtilsKanaTableEntry KKC_ROM_KANA_UTILS_HankakuKatakanaSubstitute[3] = {{12526U, NULL, "ﾜ"}, {12533U, NULL, "ｶ"}, {12534U, NULL, "ｹ"}};
static const gchar* KKC_ROM_KANA_UTILS_WideLatinTable[95] = {"　", "！", "”", "＃", "＄", "％", "＆", "’", "（", "）", "＊", "＋", "，", "−", "．", "／", "０", "１", "２", "３", "４", "５", "６", "７", "８", "９", "：", "；", "＜", "＝", "＞", "？", "＠", "Ａ", "Ｂ", "Ｃ", "Ｄ", "Ｅ", "Ｆ", "Ｇ", "Ｈ", "Ｉ", "Ｊ", "Ｋ", "Ｌ", "Ｍ", "Ｎ", "Ｏ", "Ｐ", "Ｑ", "Ｒ", "Ｓ", "Ｔ", "Ｕ", "Ｖ", "Ｗ", "Ｘ", "Ｙ", "Ｚ", "［", "＼", "］", "＾", "＿", "‘", "ａ", "ｂ", "ｃ", "ｄ", "ｅ", "ｆ", "ｇ", "ｈ", "ｉ", "ｊ", "ｋ", "ｌ", "ｍ", "ｎ", "ｏ", "ｐ", "ｑ", "ｒ", "ｓ", "ｔ", "ｕ", "ｖ", "ｗ", "ｘ", "ｙ", "ｚ", "｛", "｜", "｝", "〜"};
static const gchar* KKC_ROM_KANA_UTILS_KanaRomTable[83] = {"x", "a", "x", "i", "x", "u", "x", "e", "x", "o", "k", "g", "k", "g", "k", "g", "k", "g", "k", "g", "s", "z", "s", "z", "s", "z", "s", "z", "s", "z", "t", "d", "t", "d", "t", "t", "d", "t", "d", "t", "d", "n", "n", "n", "n", "n", "h", "b", "p", "h", "b", "p", "h", "b", "p", "h", "b", "p", "h", "b", "p", "m", "m", "m", "m", "m", "x", "y", "x", "y", "x", "y", "r", "r", "r", "r", "r", "x", "w", "x", "x", "w", "n"};
static const gchar* KKC_ROM_KANA_UTILS_KanjiNumericTable[10] = {"〇", "一", "二", "三", "四", "五", "六", "七", "八", "九"};
static const gchar* KKC_ROM_KANA_UTILS_DaijiNumericTable[10] = {"零", "壱", "弐", "参", "四", "伍", "六", "七", "八", "九"};
static const gchar* KKC_ROM_KANA_UTILS_KanjiNumericalPositionTable[18] = {NULL, "十", "百", "千", "万", NULL, NULL, NULL, "億", NULL, NULL, NULL, "兆", NULL, NULL, NULL, NULL, "京"};
static const gchar* KKC_ROM_KANA_UTILS_DaijiNumericalPositionTable[18] = {NULL, "拾", "百", "阡", "萬", NULL, NULL, NULL, "億", NULL, NULL, NULL, "兆", NULL, NULL, NULL, NULL, "京"};

static GType
kkc_numeric_conversion_type_get_type_once (void)
{
	static const GEnumValue values[] = {{KKC_NUMERIC_CONVERSION_TYPE_LATIN, "KKC_NUMERIC_CONVERSION_TYPE_LATIN", "latin"}, {KKC_NUMERIC_CONVERSION_TYPE_WIDE_LATIN, "KKC_NUMERIC_CONVERSION_TYPE_WIDE_LATIN", "wide-latin"}, {KKC_NUMERIC_CONVERSION_TYPE_KANJI_NUMERAL, "KKC_NUMERIC_CONVERSION_TYPE_KANJI_NUMERAL", "kanji-numeral"}, {KKC_NUMERIC_CONVERSION_TYPE_KANJI, "KKC_NUMERIC_CONVERSION_TYPE_KANJI", "kanji"}, {KKC_NUMERIC_CONVERSION_TYPE_RECONVERT, "KKC_NUMERIC_CONVERSION_TYPE_RECONVERT", "reconvert"}, {KKC_NUMERIC_CONVERSION_TYPE_DAIJI, "KKC_NUMERIC_CONVERSION_TYPE_DAIJI", "daiji"}, {KKC_NUMERIC_CONVERSION_TYPE_RESERVED6, "KKC_NUMERIC_CONVERSION_TYPE_RESERVED6", "reserved6"}, {KKC_NUMERIC_CONVERSION_TYPE_RESERVED7, "KKC_NUMERIC_CONVERSION_TYPE_RESERVED7", "reserved7"}, {KKC_NUMERIC_CONVERSION_TYPE_GROUPING, "KKC_NUMERIC_CONVERSION_TYPE_GROUPING", "grouping"}, {KKC_NUMERIC_CONVERSION_TYPE_SHOGI, "KKC_NUMERIC_CONVERSION_TYPE_SHOGI", "shogi"}, {0, NULL, NULL}};
	GType kkc_numeric_conversion_type_type_id;
	kkc_numeric_conversion_type_type_id = g_enum_register_static ("KkcNumericConversionType", values);
	return kkc_numeric_conversion_type_type_id;
}

GType
kkc_numeric_conversion_type_get_type (void)
{
	static volatile gsize kkc_numeric_conversion_type_type_id__once = 0;
	if (g_once_init_enter (&kkc_numeric_conversion_type_type_id__once)) {
		GType kkc_numeric_conversion_type_type_id;
		kkc_numeric_conversion_type_type_id = kkc_numeric_conversion_type_get_type_once ();
		g_once_init_leave (&kkc_numeric_conversion_type_type_id__once, kkc_numeric_conversion_type_type_id);
	}
	return kkc_numeric_conversion_type_type_id__once;
}

static gchar*
kkc_rom_kana_utils_get_okurigana_prefix_for_char (gunichar uc)
{
	gchar* result;
	if (uc == 12435U) {
		gchar* _tmp0_;
		_tmp0_ = g_strdup ("n");
		result = _tmp0_;
		return result;
	} else {
		gboolean _tmp1_ = FALSE;
		if (uc < 12353U) {
			_tmp1_ = TRUE;
		} else {
			_tmp1_ = uc > 12435U;
		}
		if (_tmp1_) {
			result = NULL;
			return result;
		} else {
			const gchar* _tmp2_;
			gchar* _tmp3_;
			_tmp2_ = KKC_ROM_KANA_UTILS_KanaRomTable[uc - 12353U];
			_tmp3_ = g_strdup (_tmp2_);
			result = _tmp3_;
			return result;
		}
	}
}

static gunichar
string_get_char (const gchar* self,
                 glong index)
{
	gunichar result;
	g_return_val_if_fail (self != NULL, 0U);
	result = g_utf8_get_char (((gchar*) self) + index);
	return result;
}

static gint
string_index_of_nth_char (const gchar* self,
                          glong c)
{
	gchar* _tmp0_;
	gint result;
	g_return_val_if_fail (self != NULL, -1);
	_tmp0_ = g_utf8_offset_to_pointer (self, c);
	result = (gint) (_tmp0_ - ((gchar*) self));
	return result;
}

gchar*
kkc_rom_kana_utils_get_okurigana_prefix (const gchar* okurigana)
{
	gunichar head = 0U;
	gboolean _tmp0_ = FALSE;
	gchar* _tmp1_;
	gchar* result;
	g_return_val_if_fail (okurigana != NULL, NULL);
	head = string_get_char (okurigana, (glong) 0);
	if (head == 12387U) {
		_tmp0_ = g_strcmp0 (okurigana, "っ") != 0;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		gint index = 0;
		index = string_index_of_nth_char (okurigana, (glong) 1);
		head = string_get_char (okurigana, (glong) index);
	}
	_tmp1_ = kkc_rom_kana_utils_get_okurigana_prefix_for_char (head);
	result = _tmp1_;
	return result;
}

gunichar
kkc_rom_kana_utils_get_wide_latin_char (gunichar uc)
{
	gboolean _tmp0_ = FALSE;
	gunichar result;
	if (((gunichar) 0x20) <= uc) {
		_tmp0_ = uc <= ((gunichar) 0x7E);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		const gchar* _tmp1_;
		_tmp1_ = KKC_ROM_KANA_UTILS_WideLatinTable[uc - 32];
		result = string_get_char (_tmp1_, (glong) 0);
		return result;
	}
	result = uc;
	return result;
}

static gboolean
string_get_next_char (const gchar* self,
                      gint* index,
                      gunichar* c)
{
	gunichar _vala_c = 0U;
	gboolean result;
	g_return_val_if_fail (self != NULL, FALSE);
	_vala_c = g_utf8_get_char (((gchar*) self) + (*index));
	if (_vala_c != ((gunichar) 0)) {
		gchar* _tmp0_;
		_tmp0_ = g_utf8_next_char (((gchar*) self) + (*index));
		*index = (gint) (_tmp0_ - ((gchar*) self));
		result = TRUE;
		if (c) {
			*c = _vala_c;
		}
		return result;
	} else {
		result = FALSE;
		if (c) {
			*c = _vala_c;
		}
		return result;
	}
}

gchar*
kkc_rom_kana_utils_get_wide_latin (const gchar* latin)
{
	GString* builder = NULL;
	GString* _tmp0_;
	gint index = 0;
	gunichar uc = 0U;
	GString* _tmp4_;
	const gchar* _tmp5_;
	gchar* _tmp6_;
	gchar* result;
	g_return_val_if_fail (latin != NULL, NULL);
	_tmp0_ = g_string_new ("");
	builder = _tmp0_;
	index = 0;
	while (TRUE) {
		gunichar _tmp1_ = 0U;
		gboolean _tmp2_;
		GString* _tmp3_;
		_tmp2_ = string_get_next_char (latin, &index, &_tmp1_);
		uc = _tmp1_;
		if (!_tmp2_) {
			break;
		}
		_tmp3_ = builder;
		g_string_append_unichar (_tmp3_, kkc_rom_kana_utils_get_wide_latin_char (uc));
	}
	_tmp4_ = builder;
	_tmp5_ = _tmp4_->str;
	_tmp6_ = g_strdup (_tmp5_);
	result = _tmp6_;
	_g_string_free0 (builder);
	return result;
}

static gchar*
g_unichar_to_string (gunichar self)
{
	gchar* str = NULL;
	gchar* _tmp0_;
	gchar* result;
	_tmp0_ = g_new0 (gchar, 7);
	str = (gchar*) _tmp0_;
	g_unichar_to_utf8 (self, str);
	result = str;
	return result;
}

gchar*
kkc_rom_kana_utils_get_latin (const gchar* wide_latin)
{
	GString* builder = NULL;
	GString* _tmp0_;
	gint index = 0;
	gunichar uc = 0U;
	GString* _tmp12_;
	const gchar* _tmp13_;
	gchar* _tmp14_;
	gchar* result;
	g_return_val_if_fail (wide_latin != NULL, NULL);
	_tmp0_ = g_string_new ("");
	builder = _tmp0_;
	index = 0;
	while (TRUE) {
		gunichar _tmp1_ = 0U;
		gboolean _tmp2_;
		gchar* str = NULL;
		gchar* _tmp3_;
		GeeMap* _tmp4_;
		const gchar* _tmp5_;
		_tmp2_ = string_get_next_char (wide_latin, &index, &_tmp1_);
		uc = _tmp1_;
		if (!_tmp2_) {
			break;
		}
		_tmp3_ = g_unichar_to_string (uc);
		str = _tmp3_;
		_tmp4_ = kkc_rom_kana_utils__WideLatinToLatinTable;
		_tmp5_ = str;
		if (gee_map_has_key (_tmp4_, _tmp5_)) {
			GString* _tmp6_;
			GeeMap* _tmp7_;
			const gchar* _tmp8_;
			gpointer _tmp9_;
			_tmp6_ = builder;
			_tmp7_ = kkc_rom_kana_utils__WideLatinToLatinTable;
			_tmp8_ = str;
			_tmp9_ = gee_map_get (_tmp7_, _tmp8_);
			g_string_append_c (_tmp6_, (gchar) ((gintptr) _tmp9_));
		} else {
			GString* _tmp10_;
			const gchar* _tmp11_;
			_tmp10_ = builder;
			_tmp11_ = str;
			g_string_append (_tmp10_, _tmp11_);
		}
		_g_free0 (str);
	}
	_tmp12_ = builder;
	_tmp13_ = _tmp12_->str;
	_tmp14_ = g_strdup (_tmp13_);
	result = _tmp14_;
	_g_string_free0 (builder);
	return result;
}

gchar*
kkc_rom_kana_utils_normalize (const gchar* input)
{
	gchar* _tmp0_;
	gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* _tmp3_;
	gchar* result;
	g_return_val_if_fail (input != NULL, NULL);
	_tmp0_ = kkc_rom_kana_utils_get_hiragana (input);
	_tmp1_ = _tmp0_;
	_tmp2_ = kkc_rom_kana_utils_get_latin (_tmp1_);
	_tmp3_ = _tmp2_;
	_g_free0 (_tmp1_);
	result = _tmp3_;
	return result;
}

static gunichar
kkc_rom_kana_utils_get_katakana_char (gunichar uc)
{
	GeeMap* _tmp0_;
	gunichar result;
	_tmp0_ = kkc_rom_kana_utils__KatakanaTable;
	if (gee_map_has_key (_tmp0_, (gpointer) ((gintptr) uc))) {
		GeeMap* _tmp1_;
		gpointer _tmp2_;
		_tmp1_ = kkc_rom_kana_utils__KatakanaTable;
		_tmp2_ = gee_map_get (_tmp1_, (gpointer) ((gintptr) uc));
		result = (gunichar) ((gintptr) _tmp2_);
		return result;
	}
	result = uc;
	return result;
}

static void
kkc_rom_kana_utils_foreach_katakana (const gchar* kana,
                                     GFunc func,
                                     gpointer func_target)
{
	gint index = 0;
	gunichar uc0 = 0U;
	g_return_if_fail (kana != NULL);
	index = 0;
	while (TRUE) {
		gunichar _tmp0_ = 0U;
		gboolean _tmp1_;
		GeeMap* _tmp2_;
		_tmp1_ = string_get_next_char (kana, &index, &_tmp0_);
		uc0 = _tmp0_;
		if (!_tmp1_) {
			break;
		}
		_tmp2_ = kkc_rom_kana_utils__CompositionTable;
		if (gee_map_has_key (_tmp2_, (gpointer) ((gintptr) uc0))) {
			GeeMap* composition = NULL;
			GeeMap* _tmp3_;
			gpointer _tmp4_;
			gunichar uc1 = 0U;
			gunichar _tmp5_ = 0U;
			gboolean _tmp6_;
			_tmp3_ = kkc_rom_kana_utils__CompositionTable;
			_tmp4_ = gee_map_get (_tmp3_, (gpointer) ((gintptr) uc0));
			composition = (GeeMap*) _tmp4_;
			_tmp6_ = string_get_next_char (kana, &index, &_tmp5_);
			uc1 = _tmp5_;
			if (_tmp6_) {
				GeeMap* _tmp7_;
				_tmp7_ = composition;
				if (gee_map_has_key (_tmp7_, (gpointer) ((gintptr) uc1))) {
					GeeMap* _tmp8_;
					gpointer _tmp9_;
					_tmp8_ = composition;
					_tmp9_ = gee_map_get (_tmp8_, (gpointer) ((gintptr) uc1));
					func ((gpointer) ((gintptr) _tmp9_), func_target);
				} else {
					func ((gpointer) ((gintptr) kkc_rom_kana_utils_get_katakana_char (uc0)), func_target);
					func ((gpointer) ((gintptr) kkc_rom_kana_utils_get_katakana_char (uc1)), func_target);
				}
			} else {
				func ((gpointer) ((gintptr) kkc_rom_kana_utils_get_katakana_char (uc0)), func_target);
				_g_object_unref0 (composition);
				break;
			}
			_g_object_unref0 (composition);
		} else {
			func ((gpointer) ((gintptr) kkc_rom_kana_utils_get_katakana_char (uc0)), func_target);
		}
	}
}

static Block1Data*
block1_data_ref (Block1Data* _data1_)
{
	g_atomic_int_inc (&_data1_->_ref_count_);
	return _data1_;
}

static void
block1_data_unref (void * _userdata_)
{
	Block1Data* _data1_;
	_data1_ = (Block1Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data1_->_ref_count_)) {
		_g_string_free0 (_data1_->builder);
		g_slice_free (Block1Data, _data1_);
	}
}

static void
__lambda7_ (Block1Data* _data1_,
            gunichar uc)
{
	g_string_append_unichar (_data1_->builder, uc);
}

static void
___lambda7__gfunc (gconstpointer data,
                   gpointer self)
{
	__lambda7_ (self, (gunichar) ((gintptr) data));
}

gchar*
kkc_rom_kana_utils_get_katakana (const gchar* kana)
{
	Block1Data* _data1_;
	GString* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* result;
	g_return_val_if_fail (kana != NULL, NULL);
	_data1_ = g_slice_new0 (Block1Data);
	_data1_->_ref_count_ = 1;
	_tmp0_ = g_string_new ("");
	_data1_->builder = _tmp0_;
	kkc_rom_kana_utils_foreach_katakana (kana, ___lambda7__gfunc, _data1_);
	_tmp1_ = _data1_->builder->str;
	_tmp2_ = g_strdup (_tmp1_);
	result = _tmp2_;
	block1_data_unref (_data1_);
	_data1_ = NULL;
	return result;
}

static Block2Data*
block2_data_ref (Block2Data* _data2_)
{
	g_atomic_int_inc (&_data2_->_ref_count_);
	return _data2_;
}

static void
block2_data_unref (void * _userdata_)
{
	Block2Data* _data2_;
	_data2_ = (Block2Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data2_->_ref_count_)) {
		_g_string_free0 (_data2_->builder);
		g_slice_free (Block2Data, _data2_);
	}
}

static void
__lambda6_ (Block2Data* _data2_,
            gunichar uc)
{
	GeeMap* _tmp0_;
	_tmp0_ = kkc_rom_kana_utils__HiraganaTable;
	if (gee_map_has_key (_tmp0_, (gpointer) ((gintptr) uc))) {
		GeeMap* _tmp1_;
		gpointer _tmp2_;
		gchar* _tmp3_;
		_tmp1_ = kkc_rom_kana_utils__HiraganaTable;
		_tmp2_ = gee_map_get (_tmp1_, (gpointer) ((gintptr) uc));
		_tmp3_ = (gchar*) _tmp2_;
		g_string_append (_data2_->builder, _tmp3_);
		_g_free0 (_tmp3_);
	} else {
		g_string_append_unichar (_data2_->builder, uc);
	}
}

static void
___lambda6__gfunc (gconstpointer data,
                   gpointer self)
{
	__lambda6_ (self, (gunichar) ((gintptr) data));
}

gchar*
kkc_rom_kana_utils_get_hiragana (const gchar* kana)
{
	Block2Data* _data2_;
	GString* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* result;
	g_return_val_if_fail (kana != NULL, NULL);
	_data2_ = g_slice_new0 (Block2Data);
	_data2_->_ref_count_ = 1;
	_tmp0_ = g_string_new ("");
	_data2_->builder = _tmp0_;
	kkc_rom_kana_utils_foreach_katakana (kana, ___lambda6__gfunc, _data2_);
	_tmp1_ = _data2_->builder->str;
	_tmp2_ = g_strdup (_tmp1_);
	result = _tmp2_;
	block2_data_unref (_data2_);
	_data2_ = NULL;
	return result;
}

static Block3Data*
block3_data_ref (Block3Data* _data3_)
{
	g_atomic_int_inc (&_data3_->_ref_count_);
	return _data3_;
}

static void
block3_data_unref (void * _userdata_)
{
	Block3Data* _data3_;
	_data3_ = (Block3Data*) _userdata_;
	if (g_atomic_int_dec_and_test (&_data3_->_ref_count_)) {
		_g_string_free0 (_data3_->builder);
		g_slice_free (Block3Data, _data3_);
	}
}

static void
__lambda8_ (Block3Data* _data3_,
            gunichar uc)
{
	GeeMap* _tmp0_;
	_tmp0_ = kkc_rom_kana_utils__HankakuKatakanaTable;
	if (gee_map_has_key (_tmp0_, (gpointer) ((gintptr) uc))) {
		GeeMap* _tmp1_;
		gpointer _tmp2_;
		gchar* _tmp3_;
		_tmp1_ = kkc_rom_kana_utils__HankakuKatakanaTable;
		_tmp2_ = gee_map_get (_tmp1_, (gpointer) ((gintptr) uc));
		_tmp3_ = (gchar*) _tmp2_;
		g_string_append (_data3_->builder, _tmp3_);
		_g_free0 (_tmp3_);
	} else {
		g_string_append_unichar (_data3_->builder, uc);
	}
}

static void
___lambda8__gfunc (gconstpointer data,
                   gpointer self)
{
	__lambda8_ (self, (gunichar) ((gintptr) data));
}

gchar*
kkc_rom_kana_utils_get_hankaku_katakana (const gchar* kana)
{
	Block3Data* _data3_;
	GString* _tmp0_;
	const gchar* _tmp1_;
	gchar* _tmp2_;
	gchar* result;
	g_return_val_if_fail (kana != NULL, NULL);
	_data3_ = g_slice_new0 (Block3Data);
	_data3_->_ref_count_ = 1;
	_tmp0_ = g_string_new ("");
	_data3_->builder = _tmp0_;
	kkc_rom_kana_utils_foreach_katakana (kana, ___lambda8__gfunc, _data3_);
	_tmp1_ = _data3_->builder->str;
	_tmp2_ = g_strdup (_tmp1_);
	result = _tmp2_;
	block3_data_unref (_data3_);
	_data3_ = NULL;
	return result;
}

gchar*
kkc_rom_kana_utils_convert_by_kana_mode (const gchar* str,
                                         KkcKanaMode mode)
{
	gchar* result;
	g_return_val_if_fail (str != NULL, NULL);
	switch (mode) {
		case KKC_KANA_MODE_HIRAGANA:
		{
			gchar* _tmp0_;
			_tmp0_ = kkc_rom_kana_utils_get_hiragana (str);
			result = _tmp0_;
			return result;
		}
		case KKC_KANA_MODE_KATAKANA:
		{
			gchar* _tmp1_;
			_tmp1_ = kkc_rom_kana_utils_get_katakana (str);
			result = _tmp1_;
			return result;
		}
		case KKC_KANA_MODE_HANKAKU_KATAKANA:
		{
			gchar* _tmp2_;
			_tmp2_ = kkc_rom_kana_utils_get_hankaku_katakana (str);
			result = _tmp2_;
			return result;
		}
		case KKC_KANA_MODE_LATIN:
		{
			gchar* _tmp3_;
			_tmp3_ = kkc_rom_kana_utils_get_latin (str);
			result = _tmp3_;
			return result;
		}
		case KKC_KANA_MODE_WIDE_LATIN:
		{
			gchar* _tmp4_;
			_tmp4_ = kkc_rom_kana_utils_get_wide_latin (str);
			result = _tmp4_;
			return result;
		}
		default:
		{
			gchar* _tmp5_;
			_tmp5_ = g_strdup (str);
			result = _tmp5_;
			return result;
		}
	}
}

static gchar*
kkc_rom_kana_utils_get_kanji_numeric (gint numeric,
                                      gchar** num_table,
                                      gint num_table_length1,
                                      gchar** num_pos_table,
                                      gint num_pos_table_length1)
{
	GString* builder = NULL;
	GString* _tmp0_;
	gchar* str = NULL;
	gchar* _tmp1_;
	gunichar uc = 0U;
	gchar* result;
	_tmp0_ = g_string_new ("");
	builder = _tmp0_;
	_tmp1_ = g_strdup_printf ("%i", numeric);
	str = _tmp1_;
	if (num_pos_table == NULL) {
		GString* _tmp8_;
		const gchar* _tmp9_;
		gchar* _tmp10_;
		{
			gint index = 0;
			index = 0;
			{
				gboolean _tmp2_ = FALSE;
				_tmp2_ = TRUE;
				while (TRUE) {
					const gchar* _tmp3_;
					gunichar _tmp4_ = 0U;
					gboolean _tmp5_;
					GString* _tmp6_;
					const gchar* _tmp7_;
					if (!_tmp2_) {
					}
					_tmp2_ = FALSE;
					_tmp3_ = str;
					_tmp5_ = string_get_next_char (_tmp3_, &index, &_tmp4_);
					uc = _tmp4_;
					if (!_tmp5_) {
						break;
					}
					_tmp6_ = builder;
					_tmp7_ = num_table[uc - '0'];
					g_string_append (_tmp6_, _tmp7_);
				}
			}
		}
		_tmp8_ = builder;
		_tmp9_ = _tmp8_->str;
		_tmp10_ = g_strdup (_tmp9_);
		result = _tmp10_;
		_g_free0 (str);
		_g_string_free0 (builder);
		return result;
	} else {
		GString* _tmp30_;
		const gchar* _tmp31_;
		gchar* _tmp32_;
		{
			gint index = 0;
			index = 0;
			{
				gboolean _tmp11_ = FALSE;
				_tmp11_ = TRUE;
				while (TRUE) {
					const gchar* _tmp12_;
					gunichar _tmp13_ = 0U;
					gboolean _tmp14_;
					if (!_tmp11_) {
					}
					_tmp11_ = FALSE;
					_tmp12_ = str;
					_tmp14_ = string_get_next_char (_tmp12_, &index, &_tmp13_);
					uc = _tmp13_;
					if (!_tmp14_) {
						break;
					}
					if (uc > ((gunichar) '0')) {
						gint pos_index = 0;
						const gchar* _tmp15_;
						gint _tmp16_;
						gint _tmp17_;
						gboolean _tmp18_ = FALSE;
						gchar* pos = NULL;
						const gchar* _tmp21_;
						gchar* _tmp22_;
						gboolean _tmp23_ = FALSE;
						const gchar* _tmp24_;
						const gchar* _tmp27_;
						_tmp15_ = str;
						_tmp16_ = strlen (_tmp15_);
						_tmp17_ = _tmp16_;
						pos_index = _tmp17_ - index;
						if (uc != ((gunichar) '1')) {
							_tmp18_ = TRUE;
						} else {
							_tmp18_ = (pos_index % 4) == 0;
						}
						if (_tmp18_) {
							GString* _tmp19_;
							const gchar* _tmp20_;
							_tmp19_ = builder;
							_tmp20_ = KKC_ROM_KANA_UTILS_KanjiNumericTable[uc - '0'];
							g_string_append (_tmp19_, _tmp20_);
						}
						_tmp21_ = num_pos_table[pos_index];
						_tmp22_ = g_strdup (_tmp21_);
						pos = _tmp22_;
						_tmp24_ = pos;
						if (_tmp24_ == NULL) {
							_tmp23_ = (pos_index % 4) > 0;
						} else {
							_tmp23_ = FALSE;
						}
						if (_tmp23_) {
							const gchar* _tmp25_;
							gchar* _tmp26_;
							_tmp25_ = num_pos_table[pos_index % 4];
							_tmp26_ = g_strdup (_tmp25_);
							_g_free0 (pos);
							pos = _tmp26_;
						}
						_tmp27_ = pos;
						if (_tmp27_ != NULL) {
							GString* _tmp28_;
							const gchar* _tmp29_;
							_tmp28_ = builder;
							_tmp29_ = pos;
							g_string_append (_tmp28_, _tmp29_);
						}
						_g_free0 (pos);
					}
				}
			}
		}
		_tmp30_ = builder;
		_tmp31_ = _tmp30_->str;
		_tmp32_ = g_strdup (_tmp31_);
		result = _tmp32_;
		_g_free0 (str);
		_g_string_free0 (builder);
		return result;
	}
}

static glong
string_strnlen (gchar* str,
                glong maxlen)
{
	gchar* end = NULL;
	gchar* _tmp0_;
	gchar* _tmp1_;
	glong result;
	_tmp0_ = memchr (str, 0, (gsize) maxlen);
	end = _tmp0_;
	_tmp1_ = end;
	if (_tmp1_ == NULL) {
		result = maxlen;
		return result;
	} else {
		gchar* _tmp2_;
		_tmp2_ = end;
		result = (glong) (_tmp2_ - str);
		return result;
	}
}

static gchar*
string_substring (const gchar* self,
                  glong offset,
                  glong len)
{
	glong string_length = 0L;
	gboolean _tmp0_ = FALSE;
	gchar* _tmp3_;
	gchar* result;
	g_return_val_if_fail (self != NULL, NULL);
	if (offset >= ((glong) 0)) {
		_tmp0_ = len >= ((glong) 0);
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		string_length = string_strnlen ((gchar*) self, offset + len);
	} else {
		gint _tmp1_;
		gint _tmp2_;
		_tmp1_ = strlen (self);
		_tmp2_ = _tmp1_;
		string_length = (glong) _tmp2_;
	}
	if (offset < ((glong) 0)) {
		offset = string_length + offset;
		g_return_val_if_fail (offset >= ((glong) 0), NULL);
	} else {
		g_return_val_if_fail (offset <= string_length, NULL);
	}
	if (len < ((glong) 0)) {
		len = string_length - offset;
	}
	g_return_val_if_fail ((offset + len) <= string_length, NULL);
	_tmp3_ = g_strndup (((gchar*) self) + offset, (gsize) len);
	result = _tmp3_;
	return result;
}

static void
_vala_array_add3 (gchar** * array,
                  gint* length,
                  gint* size,
                  gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static void
_vala_array_add4 (gchar** * array,
                  gint* length,
                  gint* size,
                  gchar* value)
{
	if ((*length) == (*size)) {
		*size = (*size) ? (2 * (*size)) : 4;
		*array = g_renew (gchar*, *array, (*size) + 1);
	}
	(*array)[(*length)++] = value;
	(*array)[*length] = NULL;
}

static gchar*
_vala_g_strjoinv (const gchar* separator,
                  gchar** str_array,
                  gint str_array_length1)
{
	gboolean _tmp0_ = FALSE;
	gchar* result;
	if (separator == NULL) {
		separator = "";
	}
	if (str_array != NULL) {
		gboolean _tmp1_ = FALSE;
		if (str_array_length1 > 0) {
			_tmp1_ = TRUE;
		} else {
			gboolean _tmp2_ = FALSE;
			if (str_array_length1 == -1) {
				const gchar* _tmp3_;
				_tmp3_ = str_array[0];
				_tmp2_ = _tmp3_ != NULL;
			} else {
				_tmp2_ = FALSE;
			}
			_tmp1_ = _tmp2_;
		}
		_tmp0_ = _tmp1_;
	} else {
		_tmp0_ = FALSE;
	}
	if (_tmp0_) {
		gint i = 0;
		gsize len = 0UL;
		gint _tmp16_;
		gint _tmp17_;
		const gchar* res = NULL;
		void* _tmp18_;
		const gchar* _tmp19_ = NULL;
		const gchar* _tmp20_;
		void* ptr = NULL;
		const gchar* _tmp22_;
		void* _tmp23_;
		const gchar* _tmp33_;
		len = (gsize) 1;
		{
			gboolean _tmp4_ = FALSE;
			i = 0;
			_tmp4_ = TRUE;
			while (TRUE) {
				gboolean _tmp6_ = FALSE;
				gboolean _tmp7_ = FALSE;
				gint _tmp10_ = 0;
				const gchar* _tmp11_;
				if (!_tmp4_) {
					gint _tmp5_;
					_tmp5_ = i;
					i = _tmp5_ + 1;
				}
				_tmp4_ = FALSE;
				if (str_array_length1 != -1) {
					_tmp7_ = i < str_array_length1;
				} else {
					_tmp7_ = FALSE;
				}
				if (_tmp7_) {
					_tmp6_ = TRUE;
				} else {
					gboolean _tmp8_ = FALSE;
					if (str_array_length1 == -1) {
						const gchar* _tmp9_;
						_tmp9_ = str_array[i];
						_tmp8_ = _tmp9_ != NULL;
					} else {
						_tmp8_ = FALSE;
					}
					_tmp6_ = _tmp8_;
				}
				if (!_tmp6_) {
					break;
				}
				_tmp11_ = str_array[i];
				if (_tmp11_ != NULL) {
					const gchar* _tmp12_;
					gint _tmp13_;
					gint _tmp14_;
					_tmp12_ = str_array[i];
					_tmp13_ = strlen ((const gchar*) _tmp12_);
					_tmp14_ = _tmp13_;
					_tmp10_ = _tmp14_;
				} else {
					_tmp10_ = 0;
				}
				len += (gsize) _tmp10_;
			}
		}
		if (i == 0) {
			gchar* _tmp15_;
			_tmp15_ = g_strdup ("");
			result = _tmp15_;
			return result;
		}
		str_array_length1 = i;
		_tmp16_ = strlen ((const gchar*) separator);
		_tmp17_ = _tmp16_;
		len += (gsize) (_tmp17_ * (i - 1));
		_tmp18_ = g_malloc (len);
		res = _tmp18_;
		_tmp20_ = str_array[0];
		if (_tmp20_ != NULL) {
			const gchar* _tmp21_;
			_tmp21_ = str_array[0];
			_tmp19_ = (const gchar*) _tmp21_;
		} else {
			_tmp19_ = "";
		}
		_tmp22_ = res;
		_tmp23_ = g_stpcpy ((void*) _tmp22_, _tmp19_);
		ptr = _tmp23_;
		{
			gboolean _tmp24_ = FALSE;
			i = 1;
			_tmp24_ = TRUE;
			while (TRUE) {
				void* _tmp26_;
				void* _tmp27_;
				const gchar* _tmp28_ = NULL;
				const gchar* _tmp29_;
				void* _tmp31_;
				void* _tmp32_;
				if (!_tmp24_) {
					gint _tmp25_;
					_tmp25_ = i;
					i = _tmp25_ + 1;
				}
				_tmp24_ = FALSE;
				if (!(i < str_array_length1)) {
					break;
				}
				_tmp26_ = ptr;
				_tmp27_ = g_stpcpy (_tmp26_, (const gchar*) separator);
				ptr = _tmp27_;
				_tmp29_ = str_array[i];
				if (_tmp29_ != NULL) {
					const gchar* _tmp30_;
					_tmp30_ = str_array[i];
					_tmp28_ = (const gchar*) _tmp30_;
				} else {
					_tmp28_ = "";
				}
				_tmp31_ = ptr;
				_tmp32_ = g_stpcpy (_tmp31_, _tmp28_);
				ptr = _tmp32_;
			}
		}
		_tmp33_ = res;
		res = NULL;
		result = (gchar*) _tmp33_;
		return result;
	} else {
		gchar* _tmp34_;
		_tmp34_ = g_strdup ("");
		result = _tmp34_;
		return result;
	}
}

gchar*
kkc_rom_kana_utils_get_numeric (gint numeric,
                                KkcNumericConversionType type)
{
	gchar* _tmp19_;
	gchar* result;
	switch (type) {
		case KKC_NUMERIC_CONVERSION_TYPE_LATIN:
		{
			gchar* _tmp0_;
			_tmp0_ = g_strdup_printf ("%i", numeric);
			result = _tmp0_;
			return result;
		}
		case KKC_NUMERIC_CONVERSION_TYPE_WIDE_LATIN:
		{
			gchar* _tmp1_;
			gchar* _tmp2_;
			gchar* _tmp3_;
			gchar* _tmp4_;
			_tmp1_ = g_strdup_printf ("%i", numeric);
			_tmp2_ = _tmp1_;
			_tmp3_ = kkc_rom_kana_utils_get_wide_latin (_tmp2_);
			_tmp4_ = _tmp3_;
			_g_free0 (_tmp2_);
			result = _tmp4_;
			return result;
		}
		case KKC_NUMERIC_CONVERSION_TYPE_KANJI_NUMERAL:
		{
			gchar* _tmp5_;
			_tmp5_ = kkc_rom_kana_utils_get_kanji_numeric (numeric, KKC_ROM_KANA_UTILS_KanjiNumericTable, (gint) G_N_ELEMENTS (KKC_ROM_KANA_UTILS_KanjiNumericTable), NULL, (gint) 0);
			result = _tmp5_;
			return result;
		}
		case KKC_NUMERIC_CONVERSION_TYPE_KANJI:
		{
			gchar* _tmp6_;
			_tmp6_ = kkc_rom_kana_utils_get_kanji_numeric (numeric, KKC_ROM_KANA_UTILS_KanjiNumericTable, (gint) G_N_ELEMENTS (KKC_ROM_KANA_UTILS_KanjiNumericTable), KKC_ROM_KANA_UTILS_KanjiNumericalPositionTable, (gint) G_N_ELEMENTS (KKC_ROM_KANA_UTILS_KanjiNumericalPositionTable));
			result = _tmp6_;
			return result;
		}
		case KKC_NUMERIC_CONVERSION_TYPE_DAIJI:
		{
			gchar* _tmp7_;
			_tmp7_ = kkc_rom_kana_utils_get_kanji_numeric (numeric, KKC_ROM_KANA_UTILS_DaijiNumericTable, (gint) G_N_ELEMENTS (KKC_ROM_KANA_UTILS_DaijiNumericTable), KKC_ROM_KANA_UTILS_DaijiNumericalPositionTable, (gint) G_N_ELEMENTS (KKC_ROM_KANA_UTILS_DaijiNumericalPositionTable));
			result = _tmp7_;
			return result;
		}
		case KKC_NUMERIC_CONVERSION_TYPE_GROUPING:
		{
			gchar* str = NULL;
			gchar* _tmp8_;
			gchar** strv = NULL;
			gchar** _tmp9_;
			gint strv_length1;
			gint _strv_size_;
			gint length = 0;
			const gchar* _tmp10_;
			gint start = 0;
			gint offset = 0;
			gchar** _tmp17_;
			gint _tmp17__length1;
			gchar* _tmp18_;
			_tmp8_ = g_strdup_printf ("%i", numeric);
			str = _tmp8_;
			_tmp9_ = g_new0 (gchar*, 0 + 1);
			strv = _tmp9_;
			strv_length1 = 0;
			_strv_size_ = strv_length1;
			_tmp10_ = str;
			length = g_utf8_strlen (_tmp10_, (gssize) -1);
			start = length % 3;
			offset = 0;
			if (start > 0) {
				const gchar* _tmp11_;
				const gchar* _tmp12_;
				gchar* _tmp13_;
				_tmp11_ = str;
				offset = string_index_of_nth_char (_tmp11_, (glong) start);
				_tmp12_ = str;
				_tmp13_ = string_substring (_tmp12_, (glong) 0, (glong) offset);
				_vala_array_add3 (&strv, &strv_length1, &_strv_size_, _tmp13_);
			}
			while (TRUE) {
				gint next_offset = 0;
				const gchar* _tmp14_;
				const gchar* _tmp15_;
				gchar* _tmp16_;
				if (!(start < length)) {
					break;
				}
				_tmp14_ = str;
				next_offset = string_index_of_nth_char (_tmp14_, (glong) (start + 3));
				_tmp15_ = str;
				_tmp16_ = string_substring (_tmp15_, (glong) offset, (glong) (next_offset - offset));
				_vala_array_add4 (&strv, &strv_length1, &_strv_size_, _tmp16_);
				offset = next_offset;
				start += 3;
			}
			_tmp17_ = strv;
			_tmp17__length1 = strv_length1;
			_tmp18_ = _vala_g_strjoinv (",", _tmp17_, (gint) _tmp17__length1);
			result = _tmp18_;
			strv = (_vala_array_free (strv, strv_length1, (GDestroyNotify) g_free), NULL);
			_g_free0 (str);
			return result;
		}
		default:
		{
			break;
		}
	}
	_tmp19_ = g_strdup ("");
	result = _tmp19_;
	return result;
}

gboolean
kkc_rom_kana_utils_is_katakana (const gchar* str)
{
	gint index = 0;
	gunichar uc = 0U;
	gboolean result;
	g_return_val_if_fail (str != NULL, FALSE);
	index = 0;
	while (TRUE) {
		gunichar _tmp0_ = 0U;
		gboolean _tmp1_;
		gboolean _tmp2_ = FALSE;
		_tmp1_ = string_get_next_char (str, &index, &_tmp0_);
		uc = _tmp0_;
		if (!_tmp1_) {
			break;
		}
		if (uc < ((gunichar) 0x30a0)) {
			_tmp2_ = TRUE;
		} else {
			_tmp2_ = uc > ((gunichar) 0x30ff);
		}
		if (_tmp2_) {
			result = FALSE;
			return result;
		}
	}
	result = TRUE;
	return result;
}

gboolean
kkc_rom_kana_utils_is_hiragana (const gchar* str)
{
	gint index = 0;
	gunichar uc = 0U;
	gboolean result;
	g_return_val_if_fail (str != NULL, FALSE);
	index = 0;
	while (TRUE) {
		gunichar _tmp0_ = 0U;
		gboolean _tmp1_;
		gboolean _tmp2_ = FALSE;
		_tmp1_ = string_get_next_char (str, &index, &_tmp0_);
		uc = _tmp0_;
		if (!_tmp1_) {
			break;
		}
		if (uc < ((gunichar) 0x3041)) {
			_tmp2_ = TRUE;
		} else {
			_tmp2_ = uc > ((gunichar) 0x309f);
		}
		if (_tmp2_) {
			result = FALSE;
			return result;
		}
	}
	result = TRUE;
	return result;
}

KkcRomKanaUtils*
kkc_rom_kana_utils_construct (GType object_type)
{
	KkcRomKanaUtils * self = NULL;
	self = (KkcRomKanaUtils*) g_object_new (object_type, NULL);
	return self;
}

static void
kkc_rom_kana_utils_kana_table_entry_copy (const KkcRomKanaUtilsKanaTableEntry* self,
                                          KkcRomKanaUtilsKanaTableEntry* dest)
{
	const gchar* _tmp0_;
	gchar* _tmp1_;
	const gchar* _tmp2_;
	gchar* _tmp3_;
	(*dest).katakana = (*self).katakana;
	_tmp0_ = (*self).hiragana;
	_tmp1_ = g_strdup (_tmp0_);
	_g_free0 ((*dest).hiragana);
	(*dest).hiragana = _tmp1_;
	_tmp2_ = (*self).hankaku_katakana;
	_tmp3_ = g_strdup (_tmp2_);
	_g_free0 ((*dest).hankaku_katakana);
	(*dest).hankaku_katakana = _tmp3_;
}

static void
kkc_rom_kana_utils_kana_table_entry_destroy (KkcRomKanaUtilsKanaTableEntry* self)
{
	_g_free0 ((*self).hiragana);
	_g_free0 ((*self).hankaku_katakana);
}

static KkcRomKanaUtilsKanaTableEntry*
kkc_rom_kana_utils_kana_table_entry_dup (const KkcRomKanaUtilsKanaTableEntry* self)
{
	KkcRomKanaUtilsKanaTableEntry* dup;
	dup = g_new0 (KkcRomKanaUtilsKanaTableEntry, 1);
	kkc_rom_kana_utils_kana_table_entry_copy (self, dup);
	return dup;
}

static void
kkc_rom_kana_utils_kana_table_entry_free (KkcRomKanaUtilsKanaTableEntry* self)
{
	kkc_rom_kana_utils_kana_table_entry_destroy (self);
	g_free (self);
}

static GType
kkc_rom_kana_utils_kana_table_entry_get_type_once (void)
{
	GType kkc_rom_kana_utils_kana_table_entry_type_id;
	kkc_rom_kana_utils_kana_table_entry_type_id = g_boxed_type_register_static ("KkcRomKanaUtilsKanaTableEntry", (GBoxedCopyFunc) kkc_rom_kana_utils_kana_table_entry_dup, (GBoxedFreeFunc) kkc_rom_kana_utils_kana_table_entry_free);
	return kkc_rom_kana_utils_kana_table_entry_type_id;
}

static GType
kkc_rom_kana_utils_kana_table_entry_get_type (void)
{
	static volatile gsize kkc_rom_kana_utils_kana_table_entry_type_id__once = 0;
	if (g_once_init_enter (&kkc_rom_kana_utils_kana_table_entry_type_id__once)) {
		GType kkc_rom_kana_utils_kana_table_entry_type_id;
		kkc_rom_kana_utils_kana_table_entry_type_id = kkc_rom_kana_utils_kana_table_entry_get_type_once ();
		g_once_init_leave (&kkc_rom_kana_utils_kana_table_entry_type_id__once, kkc_rom_kana_utils_kana_table_entry_type_id);
	}
	return kkc_rom_kana_utils_kana_table_entry_type_id__once;
}

static void
kkc_rom_kana_utils_class_init (KkcRomKanaUtilsClass * klass,
                               gpointer klass_data)
{
	GeeHashMap* _tmp0_;
	GeeHashMap* _tmp1_;
	GeeHashMap* _tmp2_;
	GeeHashMap* _tmp3_;
	GeeHashMap* _tmp4_;
	kkc_rom_kana_utils_parent_class = g_type_class_peek_parent (klass);
	G_OBJECT_CLASS (klass)->finalize = kkc_rom_kana_utils_finalize;
	_tmp0_ = gee_hash_map_new (G_TYPE_UINT, NULL, NULL, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	kkc_rom_kana_utils__HiraganaTable = (GeeMap*) _tmp0_;
	_tmp1_ = gee_hash_map_new (G_TYPE_UINT, NULL, NULL, G_TYPE_UINT, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	kkc_rom_kana_utils__KatakanaTable = (GeeMap*) _tmp1_;
	_tmp2_ = gee_hash_map_new (G_TYPE_UINT, NULL, NULL, G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	kkc_rom_kana_utils__HankakuKatakanaTable = (GeeMap*) _tmp2_;
	_tmp3_ = gee_hash_map_new (G_TYPE_UINT, NULL, NULL, GEE_TYPE_HASH_MAP, (GBoxedCopyFunc) g_object_ref, (GDestroyNotify) g_object_unref, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	kkc_rom_kana_utils__CompositionTable = (GeeMap*) _tmp3_;
	_tmp4_ = gee_hash_map_new (G_TYPE_STRING, (GBoxedCopyFunc) g_strdup, (GDestroyNotify) g_free, G_TYPE_CHAR, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
	kkc_rom_kana_utils__WideLatinToLatinTable = (GeeMap*) _tmp4_;
	{
		KkcRomKanaUtilsKanaTableEntry* entry_collection = NULL;
		gint entry_collection_length1 = 0;
		gint _entry_collection_size_ = 0;
		gint entry_it = 0;
		entry_collection = KKC_ROM_KANA_UTILS_KanaTable;
		entry_collection_length1 = G_N_ELEMENTS (KKC_ROM_KANA_UTILS_KanaTable);
		for (entry_it = 0; entry_it < entry_collection_length1; entry_it = entry_it + 1) {
			KkcRomKanaUtilsKanaTableEntry entry = {0};
			entry = entry_collection[entry_it];
			{
				GeeMap* _tmp5_;
				KkcRomKanaUtilsKanaTableEntry _tmp6_;
				KkcRomKanaUtilsKanaTableEntry _tmp7_;
				const gchar* _tmp8_;
				GeeMap* _tmp9_;
				KkcRomKanaUtilsKanaTableEntry _tmp10_;
				KkcRomKanaUtilsKanaTableEntry _tmp11_;
				const gchar* _tmp12_;
				KkcRomKanaUtilsKanaTableEntry _tmp17_;
				const gchar* _tmp18_;
				KkcRomKanaUtilsKanaTableEntry _tmp39_;
				const gchar* _tmp40_;
				_tmp5_ = kkc_rom_kana_utils__HiraganaTable;
				_tmp6_ = entry;
				_tmp7_ = entry;
				_tmp8_ = _tmp7_.hiragana;
				gee_map_set (_tmp5_, (gpointer) ((gintptr) _tmp6_.katakana), _tmp8_);
				_tmp9_ = kkc_rom_kana_utils__HankakuKatakanaTable;
				_tmp10_ = entry;
				_tmp11_ = entry;
				_tmp12_ = _tmp11_.hankaku_katakana;
				gee_map_set (_tmp9_, (gpointer) ((gintptr) _tmp10_.katakana), _tmp12_);
				{
					KkcRomKanaUtilsKanaTableEntry* substitute_collection = NULL;
					gint substitute_collection_length1 = 0;
					gint _substitute_collection_size_ = 0;
					gint substitute_it = 0;
					substitute_collection = KKC_ROM_KANA_UTILS_HankakuKatakanaSubstitute;
					substitute_collection_length1 = G_N_ELEMENTS (KKC_ROM_KANA_UTILS_HankakuKatakanaSubstitute);
					for (substitute_it = 0; substitute_it < substitute_collection_length1; substitute_it = substitute_it + 1) {
						KkcRomKanaUtilsKanaTableEntry substitute = {0};
						substitute = substitute_collection[substitute_it];
						{
							GeeMap* _tmp13_;
							KkcRomKanaUtilsKanaTableEntry _tmp14_;
							KkcRomKanaUtilsKanaTableEntry _tmp15_;
							const gchar* _tmp16_;
							_tmp13_ = kkc_rom_kana_utils__HankakuKatakanaTable;
							_tmp14_ = substitute;
							_tmp15_ = substitute;
							_tmp16_ = _tmp15_.hankaku_katakana;
							gee_map_set (_tmp13_, (gpointer) ((gintptr) _tmp14_.katakana), _tmp16_);
						}
					}
				}
				_tmp17_ = entry;
				_tmp18_ = _tmp17_.hiragana;
				if (_tmp18_ != NULL) {
					KkcRomKanaUtilsKanaTableEntry _tmp19_;
					const gchar* _tmp20_;
					_tmp19_ = entry;
					_tmp20_ = _tmp19_.hiragana;
					if (g_utf8_strlen (_tmp20_, (gssize) -1) > 1) {
						gint index = 0;
						gunichar uc0 = 0U;
						gunichar uc1 = 0U;
						KkcRomKanaUtilsKanaTableEntry _tmp21_;
						const gchar* _tmp22_;
						gunichar _tmp23_ = 0U;
						KkcRomKanaUtilsKanaTableEntry _tmp24_;
						const gchar* _tmp25_;
						gunichar _tmp26_ = 0U;
						GeeMap* _tmp27_;
						GeeMap* composition = NULL;
						GeeMap* _tmp31_;
						gpointer _tmp32_;
						GeeMap* _tmp33_;
						KkcRomKanaUtilsKanaTableEntry _tmp34_;
						index = 0;
						_tmp21_ = entry;
						_tmp22_ = _tmp21_.hiragana;
						string_get_next_char (_tmp22_, &index, &_tmp23_);
						uc0 = _tmp23_;
						_tmp24_ = entry;
						_tmp25_ = _tmp24_.hiragana;
						string_get_next_char (_tmp25_, &index, &_tmp26_);
						uc1 = _tmp26_;
						_tmp27_ = kkc_rom_kana_utils__CompositionTable;
						if (!gee_map_has_key (_tmp27_, (gpointer) ((gintptr) uc0))) {
							GeeMap* _tmp28_;
							GeeHashMap* _tmp29_;
							GeeHashMap* _tmp30_;
							_tmp28_ = kkc_rom_kana_utils__CompositionTable;
							_tmp29_ = gee_hash_map_new (G_TYPE_UINT, NULL, NULL, G_TYPE_UINT, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
							_tmp30_ = _tmp29_;
							gee_map_set (_tmp28_, (gpointer) ((gintptr) uc0), (GeeMap*) _tmp30_);
							_g_object_unref0 (_tmp30_);
						}
						_tmp31_ = kkc_rom_kana_utils__CompositionTable;
						_tmp32_ = gee_map_get (_tmp31_, (gpointer) ((gintptr) uc0));
						composition = (GeeMap*) _tmp32_;
						_tmp33_ = composition;
						_tmp34_ = entry;
						gee_map_set (_tmp33_, (gpointer) ((gintptr) uc1), (gpointer) ((gintptr) _tmp34_.katakana));
						_g_object_unref0 (composition);
					} else {
						GeeMap* _tmp35_;
						KkcRomKanaUtilsKanaTableEntry _tmp36_;
						const gchar* _tmp37_;
						KkcRomKanaUtilsKanaTableEntry _tmp38_;
						_tmp35_ = kkc_rom_kana_utils__KatakanaTable;
						_tmp36_ = entry;
						_tmp37_ = _tmp36_.hiragana;
						_tmp38_ = entry;
						gee_map_set (_tmp35_, (gpointer) ((gintptr) string_get_char (_tmp37_, (glong) 0)), (gpointer) ((gintptr) _tmp38_.katakana));
					}
				}
				_tmp39_ = entry;
				_tmp40_ = _tmp39_.hankaku_katakana;
				if (_tmp40_ != NULL) {
					KkcRomKanaUtilsKanaTableEntry _tmp41_;
					const gchar* _tmp42_;
					_tmp41_ = entry;
					_tmp42_ = _tmp41_.hankaku_katakana;
					if (g_utf8_strlen (_tmp42_, (gssize) -1) > 1) {
						gint index = 0;
						gunichar uc0 = 0U;
						gunichar uc1 = 0U;
						KkcRomKanaUtilsKanaTableEntry _tmp43_;
						const gchar* _tmp44_;
						gunichar _tmp45_ = 0U;
						KkcRomKanaUtilsKanaTableEntry _tmp46_;
						const gchar* _tmp47_;
						gunichar _tmp48_ = 0U;
						GeeMap* _tmp49_;
						GeeMap* composition = NULL;
						GeeMap* _tmp53_;
						gpointer _tmp54_;
						GeeMap* _tmp55_;
						KkcRomKanaUtilsKanaTableEntry _tmp56_;
						index = 0;
						_tmp43_ = entry;
						_tmp44_ = _tmp43_.hankaku_katakana;
						string_get_next_char (_tmp44_, &index, &_tmp45_);
						uc0 = _tmp45_;
						_tmp46_ = entry;
						_tmp47_ = _tmp46_.hankaku_katakana;
						string_get_next_char (_tmp47_, &index, &_tmp48_);
						uc1 = _tmp48_;
						_tmp49_ = kkc_rom_kana_utils__CompositionTable;
						if (!gee_map_has_key (_tmp49_, (gpointer) ((gintptr) uc0))) {
							GeeMap* _tmp50_;
							GeeHashMap* _tmp51_;
							GeeHashMap* _tmp52_;
							_tmp50_ = kkc_rom_kana_utils__CompositionTable;
							_tmp51_ = gee_hash_map_new (G_TYPE_UINT, NULL, NULL, G_TYPE_UINT, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
							_tmp52_ = _tmp51_;
							gee_map_set (_tmp50_, (gpointer) ((gintptr) uc0), (GeeMap*) _tmp52_);
							_g_object_unref0 (_tmp52_);
						}
						_tmp53_ = kkc_rom_kana_utils__CompositionTable;
						_tmp54_ = gee_map_get (_tmp53_, (gpointer) ((gintptr) uc0));
						composition = (GeeMap*) _tmp54_;
						_tmp55_ = composition;
						_tmp56_ = entry;
						gee_map_set (_tmp55_, (gpointer) ((gintptr) uc1), (gpointer) ((gintptr) _tmp56_.katakana));
						_g_object_unref0 (composition);
					} else {
						gunichar uc = 0U;
						KkcRomKanaUtilsKanaTableEntry _tmp57_;
						const gchar* _tmp58_;
						GeeMap* _tmp59_;
						_tmp57_ = entry;
						_tmp58_ = _tmp57_.hankaku_katakana;
						uc = string_get_char (_tmp58_, (glong) 0);
						_tmp59_ = kkc_rom_kana_utils__KatakanaTable;
						if (!gee_map_has_key (_tmp59_, (gpointer) ((gintptr) uc))) {
							GeeMap* _tmp60_;
							KkcRomKanaUtilsKanaTableEntry _tmp61_;
							_tmp60_ = kkc_rom_kana_utils__KatakanaTable;
							_tmp61_ = entry;
							gee_map_set (_tmp60_, (gpointer) ((gintptr) uc), (gpointer) ((gintptr) _tmp61_.katakana));
						}
					}
				}
			}
		}
	}
	{
		gint i = 0;
		i = 0;
		{
			gboolean _tmp62_ = FALSE;
			_tmp62_ = TRUE;
			while (TRUE) {
				GeeMap* _tmp64_;
				const gchar* _tmp65_;
				if (!_tmp62_) {
					gint _tmp63_;
					_tmp63_ = i;
					i = _tmp63_ + 1;
				}
				_tmp62_ = FALSE;
				if (!(i < G_N_ELEMENTS (KKC_ROM_KANA_UTILS_WideLatinTable))) {
					break;
				}
				_tmp64_ = kkc_rom_kana_utils__WideLatinToLatinTable;
				_tmp65_ = KKC_ROM_KANA_UTILS_WideLatinTable[i];
				gee_map_set (_tmp64_, _tmp65_, (gpointer) ((gintptr) (i + 32)));
			}
		}
	}
}

static void
kkc_rom_kana_utils_instance_init (KkcRomKanaUtils * self,
                                  gpointer klass)
{
}

static void
kkc_rom_kana_utils_finalize (GObject * obj)
{
	KkcRomKanaUtils * self;
	self = G_TYPE_CHECK_INSTANCE_CAST (obj, KKC_TYPE_ROM_KANA_UTILS, KkcRomKanaUtils);
	G_OBJECT_CLASS (kkc_rom_kana_utils_parent_class)->finalize (obj);
}

static GType
kkc_rom_kana_utils_get_type_once (void)
{
	static const GTypeInfo g_define_type_info = { sizeof (KkcRomKanaUtilsClass), (GBaseInitFunc) NULL, (GBaseFinalizeFunc) NULL, (GClassInitFunc) kkc_rom_kana_utils_class_init, (GClassFinalizeFunc) NULL, NULL, sizeof (KkcRomKanaUtils), 0, (GInstanceInitFunc) kkc_rom_kana_utils_instance_init, NULL };
	GType kkc_rom_kana_utils_type_id;
	kkc_rom_kana_utils_type_id = g_type_register_static (G_TYPE_OBJECT, "KkcRomKanaUtils", &g_define_type_info, G_TYPE_FLAG_ABSTRACT);
	return kkc_rom_kana_utils_type_id;
}

GType
kkc_rom_kana_utils_get_type (void)
{
	static volatile gsize kkc_rom_kana_utils_type_id__once = 0;
	if (g_once_init_enter (&kkc_rom_kana_utils_type_id__once)) {
		GType kkc_rom_kana_utils_type_id;
		kkc_rom_kana_utils_type_id = kkc_rom_kana_utils_get_type_once ();
		g_once_init_leave (&kkc_rom_kana_utils_type_id__once, kkc_rom_kana_utils_type_id);
	}
	return kkc_rom_kana_utils_type_id__once;
}

static void
_vala_array_destroy (gpointer array,
                     gssize array_length,
                     GDestroyNotify destroy_func)
{
	if ((array != NULL) && (destroy_func != NULL)) {
		gssize i;
		for (i = 0; i < array_length; i = i + 1) {
			if (((gpointer*) array)[i] != NULL) {
				destroy_func (((gpointer*) array)[i]);
			}
		}
	}
}

static void
_vala_array_free (gpointer array,
                  gssize array_length,
                  GDestroyNotify destroy_func)
{
	_vala_array_destroy (array, array_length, destroy_func);
	g_free (array);
}

