KkcRomKanaCharacterList

KkcRomKanaCharacterList — A list of RomKanaCharacter

Functions

void kkc_rom_kana_character_list_add ()
void kkc_rom_kana_character_list_add_all ()
void kkc_rom_kana_character_list_insert ()
void kkc_rom_kana_character_list_insert_all ()
void kkc_rom_kana_character_list_get ()
void kkc_rom_kana_character_list_clear ()
KkcRomKanaCharacterList * kkc_rom_kana_character_list_slice ()
void kkc_rom_kana_character_list_remove_at ()
gchar * kkc_rom_kana_character_list_get_output ()
gchar * kkc_rom_kana_character_list_get_input ()
KkcRomKanaCharacterList * kkc_rom_kana_character_list_new ()
gint kkc_rom_kana_character_list_get_size ()
gchar * kkc_rom_kana_converter_get_produced_output ()
gboolean kkc_rom_kana_converter_is_valid ()
gboolean kkc_rom_kana_converter_flush_partial ()
void kkc_rom_kana_converter_append_text ()
gboolean kkc_rom_kana_converter_append ()
gboolean kkc_rom_kana_converter_can_consume ()
void kkc_rom_kana_converter_reset ()
gboolean kkc_rom_kana_converter_delete ()
KkcRomKanaConverter * kkc_rom_kana_converter_new ()
KkcKanaMode kkc_rom_kana_converter_get_kana_mode ()
void kkc_rom_kana_converter_set_kana_mode ()
KkcPunctuationStyle kkc_rom_kana_converter_get_punctuation_style ()
void kkc_rom_kana_converter_set_punctuation_style ()
gboolean kkc_rom_kana_converter_get_auto_correct ()
void kkc_rom_kana_converter_set_auto_correct ()
const gchar * kkc_rom_kana_converter_get_pending_output ()
const gchar * kkc_rom_kana_converter_get_pending_input ()
KkcRomKanaCharacterList * kkc_rom_kana_converter_get_produced ()
KkcRomKanaCharacter * kkc_rom_kana_character_dup ()
void kkc_rom_kana_character_free ()
void kkc_rom_kana_character_copy ()
void kkc_rom_kana_character_destroy ()

Properties

gint size Read
gboolean auto-correct Read / Write
KkcKanaMode kana-mode Read / Write
gchar * pending-input Read
gchar * pending-output Read
KkcRomKanaCharacterList * produced Read
KkcPunctuationStyle punctuation-style Read / Write
KkcRomKanaMapFile * rule Read / Write

Types and Values

Object Hierarchy

    GBoxed
    ╰── KkcRomKanaCharacter
    GEnum
    ├── KkcKanaMode
    ╰── KkcPunctuationStyle
    GObject
    ├── KkcRomKanaCharacterList
    ╰── KkcRomKanaConverter

Description

Functions

kkc_rom_kana_character_list_add ()

void
kkc_rom_kana_character_list_add (KkcRomKanaCharacterList *self,
                                 KkcRomKanaCharacter *character);

Append a character to the character list.

Parameters

self

the KkcRomKanaCharacterList instance

 

character

 .

a RomKanaCharacter

.

[in]

kkc_rom_kana_character_list_add_all ()

void
kkc_rom_kana_character_list_add_all (KkcRomKanaCharacterList *self,
                                     KkcRomKanaCharacterList *other);

Append all characters in other character list to the character list.

Parameters

self

the KkcRomKanaCharacterList instance

 

other

 .

RomKanaCharacterList

.

[in]

kkc_rom_kana_character_list_insert ()

void
kkc_rom_kana_character_list_insert (KkcRomKanaCharacterList *self,
                                    gint index,
                                    KkcRomKanaCharacter *character);

Add a character to the character list at the specified position.

Parameters

self

the KkcRomKanaCharacterList instance

 

index

 .

index

.

[in]

character

 .

RomKanaCharacter

.

[in]

kkc_rom_kana_character_list_insert_all ()

void
kkc_rom_kana_character_list_insert_all
                               (KkcRomKanaCharacterList *self,
                                gint index,
                                KkcRomKanaCharacterList *other);

Add all characters in other character list to the character list at the specified position.

Parameters

self

the KkcRomKanaCharacterList instance

 

index

 .

index

.

[in]

other

 .

RomKanaCharacterList

.

[in]

kkc_rom_kana_character_list_get ()

void
kkc_rom_kana_character_list_get (KkcRomKanaCharacterList *self,
                                 gint index,
                                 KkcRomKanaCharacter *result);

Get a character at the given index.

Parameters

self

the KkcRomKanaCharacterList instance

 

index

 .

index

.

[in]

Returns

a RomKanaCharacter


kkc_rom_kana_character_list_clear ()

void
kkc_rom_kana_character_list_clear (KkcRomKanaCharacterList *self);

Remove all characters from the character list.

Parameters

self

the KkcRomKanaCharacterList instance

 

kkc_rom_kana_character_list_slice ()

KkcRomKanaCharacterList *
kkc_rom_kana_character_list_slice (KkcRomKanaCharacterList *self,
                                   gint start_char_pos,
                                   gint stop_char_pos);

Return a slice of this character list.

Parameters

self

the KkcRomKanaCharacterList instance

 

start_char_pos

 .

zero-based index of the begin of the slice

.

[in]

stop_char_pos

 .

zero-based index after the end of the slice

.

[in]

Returns

a RomKanaCharacterList


kkc_rom_kana_character_list_remove_at ()

void
kkc_rom_kana_character_list_remove_at (KkcRomKanaCharacterList *self,
                                       gint index);

Remove a character at the given index.

Parameters

self

the KkcRomKanaCharacterList instance

 

index

 .

index

.

[in]

kkc_rom_kana_character_list_get_output ()

gchar *
kkc_rom_kana_character_list_get_output
                               (KkcRomKanaCharacterList *self);

Return the concatenation of all character output as a string.

Parameters

self

the KkcRomKanaCharacterList instance

 

Returns

a string


kkc_rom_kana_character_list_get_input ()

gchar *
kkc_rom_kana_character_list_get_input (KkcRomKanaCharacterList *self);

Return the concatenation of all character input as a string.

Parameters

self

the KkcRomKanaCharacterList instance

 

Returns

a string


kkc_rom_kana_character_list_new ()

KkcRomKanaCharacterList *
kkc_rom_kana_character_list_new (void);

kkc_rom_kana_character_list_get_size ()

gint
kkc_rom_kana_character_list_get_size (KkcRomKanaCharacterList *self);

Get and return the current value of the "size" property.

The number of characters in the character list.

Parameters

self

the KkcRomKanaCharacterList instance to query

 

Returns

the value of the "size" property


kkc_rom_kana_converter_get_produced_output ()

gchar *
kkc_rom_kana_converter_get_produced_output
                               (KkcRomKanaConverter *self);

Return the concatenation of the produced output characters.

Parameters

self

the KkcRomKanaConverter instance

 

Returns

a string


kkc_rom_kana_converter_is_valid ()

gboolean
kkc_rom_kana_converter_is_valid (KkcRomKanaConverter *self,
                                 gunichar uc);

Check if a character is a valid conversion input.

Parameters

self

the KkcRomKanaConverter instance

 

uc

 .

unichar

.

[in]

Returns

`true` if uc is in a valid range, `false` otherwise


kkc_rom_kana_converter_flush_partial ()

gboolean
kkc_rom_kana_converter_flush_partial (KkcRomKanaConverter *self);

Finish pending input, if any.

Note that this does not reset pending input/output and the current node if there is no partial output.

Parameters

self

the KkcRomKanaConverter instance

 

Returns

`true` if there is partial output, `false` otherwise


kkc_rom_kana_converter_append_text ()

void
kkc_rom_kana_converter_append_text (KkcRomKanaConverter *self,
                                    const gchar *text);

Append text to the internal buffer.

Parameters

self

the KkcRomKanaConverter instance

 

text

 .

a string

.

[in]

kkc_rom_kana_converter_append ()

gboolean
kkc_rom_kana_converter_append (KkcRomKanaConverter *self,
                               gunichar uc);

Append a character to the internal buffer.

Parameters

self

the KkcRomKanaConverter instance

 

uc

 .

an ASCII character

.

[in]

Returns

`true` if the character is handled, `false` otherwise


kkc_rom_kana_converter_can_consume ()

gboolean
kkc_rom_kana_converter_can_consume (KkcRomKanaConverter *self,
                                    gunichar uc,
                                    gboolean no_carryover);

Check if a character will be consumed by the current conversion.

Parameters

self

the KkcRomKanaConverter instance

 

uc

 .

an ASCII character

.

[in]

no_carryover

 .

return false if there will be carryover

.

[in]

Returns

`true` if the character can be consumed


kkc_rom_kana_converter_reset ()

void
kkc_rom_kana_converter_reset (KkcRomKanaConverter *self);

Reset the internal state of the converter.

Parameters

self

the KkcRomKanaConverter instance

 

kkc_rom_kana_converter_delete ()

gboolean
kkc_rom_kana_converter_delete (KkcRomKanaConverter *self);

Delete the trailing character from the internal buffer.

Parameters

self

the KkcRomKanaConverter instance

 

Returns

`true` if any character is removed, `false` otherwise


kkc_rom_kana_converter_new ()

KkcRomKanaConverter *
kkc_rom_kana_converter_new (void);

Create a new RomKanaConverter.

Returns

a new RomKanaConverter


kkc_rom_kana_converter_get_kana_mode ()

KkcKanaMode
kkc_rom_kana_converter_get_kana_mode (KkcRomKanaConverter *self);

Get and return the current value of the "kana-mode" property.

The current kana mode.

Parameters

self

the KkcRomKanaConverter instance to query

 

Returns

the value of the "kana-mode" property


kkc_rom_kana_converter_set_kana_mode ()

void
kkc_rom_kana_converter_set_kana_mode (KkcRomKanaConverter *self,
                                      KkcKanaMode value);

Set the value of the "kana-mode" property to value .

The current kana mode.

Parameters

self

the KkcRomKanaConverter instance to modify

 

value

the new value of the "kana-mode" property

 

kkc_rom_kana_converter_get_punctuation_style ()

KkcPunctuationStyle
kkc_rom_kana_converter_get_punctuation_style
                               (KkcRomKanaConverter *self);

Get and return the current value of the "punctuation-style" property.

The current punctuation style.

Parameters

self

the KkcRomKanaConverter instance to query

 

Returns

the value of the "punctuation-style" property


kkc_rom_kana_converter_set_punctuation_style ()

void
kkc_rom_kana_converter_set_punctuation_style
                               (KkcRomKanaConverter *self,
                                KkcPunctuationStyle value);

Set the value of the "punctuation-style" property to value .

The current punctuation style.

Parameters

self

the KkcRomKanaConverter instance to modify

 

value

the new value of the "punctuation-style" property

 

kkc_rom_kana_converter_get_auto_correct ()

gboolean
kkc_rom_kana_converter_get_auto_correct
                               (KkcRomKanaConverter *self);

Get and return the current value of the "auto-correct" property.

The current auto correct flag.

Parameters

self

the KkcRomKanaConverter instance to query

 

Returns

the value of the "auto-correct" property


kkc_rom_kana_converter_set_auto_correct ()

void
kkc_rom_kana_converter_set_auto_correct
                               (KkcRomKanaConverter *self,
                                gboolean value);

Set the value of the "auto-correct" property to value .

The current auto correct flag.

Parameters

self

the KkcRomKanaConverter instance to modify

 

value

the new value of the "auto-correct" property

 

kkc_rom_kana_converter_get_pending_output ()

const gchar *
kkc_rom_kana_converter_get_pending_output
                               (KkcRomKanaConverter *self);

Get and return the current value of the "pending-output" property.

The output being processed.

Parameters

self

the KkcRomKanaConverter instance to query

 

Returns

the value of the "pending-output" property


kkc_rom_kana_converter_get_pending_input ()

const gchar *
kkc_rom_kana_converter_get_pending_input
                               (KkcRomKanaConverter *self);

Get and return the current value of the "pending-input" property.

The input being processed.

Parameters

self

the KkcRomKanaConverter instance to query

 

Returns

the value of the "pending-input" property


kkc_rom_kana_converter_get_produced ()

KkcRomKanaCharacterList *
kkc_rom_kana_converter_get_produced (KkcRomKanaConverter *self);

Get and return the current value of the "produced" property.

A list of already processed characters.

Parameters

self

the KkcRomKanaConverter instance to query

 

Returns

the value of the "produced" property


kkc_rom_kana_character_dup ()

KkcRomKanaCharacter *
kkc_rom_kana_character_dup (const KkcRomKanaCharacter *self);

Creates a copy of self.

See also: kkc_rom_kana_character_copy(), kkc_rom_kana_character_destroy(), kkc_rom_kana_character_free()

Parameters

self

the instance to duplicate

 

Returns

a copy of self , free with kkc_rom_kana_character_free()


kkc_rom_kana_character_free ()

void
kkc_rom_kana_character_free (KkcRomKanaCharacter *self);

Frees the heap-allocated struct.

See also: kkc_rom_kana_character_dup(), kkc_rom_kana_character_copy(), kkc_rom_kana_character_destroy()

Parameters

self

the struct to free

 

kkc_rom_kana_character_copy ()

void
kkc_rom_kana_character_copy (const KkcRomKanaCharacter *self,
                             KkcRomKanaCharacter *dest);

Creates a copy of self.

See also: kkc_rom_kana_character_dup(), kkc_rom_kana_character_destroy(), kkc_rom_kana_character_free()

Parameters

self

the struct to copy

 

dest

a unused struct. Use kkc_rom_kana_character_destroy() to free the content.

 

kkc_rom_kana_character_destroy ()

void
kkc_rom_kana_character_destroy (KkcRomKanaCharacter *self);

Frees the content of the struct pointed by self .

See also: kkc_rom_kana_character_dup(), kkc_rom_kana_character_copy(), kkc_rom_kana_character_free()

Parameters

self

the struct to destroy

 

Types and Values

KKC_TYPE_ROM_KANA_CHARACTER_LIST

#define KKC_TYPE_ROM_KANA_CHARACTER_LIST (kkc_rom_kana_character_list_get_type ())

The type for KkcRomKanaCharacterList.


struct KkcRomKanaCharacterList

struct KkcRomKanaCharacterList;

A list of RomKanaCharacter


struct KkcRomKanaCharacterListClass

struct KkcRomKanaCharacterListClass {
	GObjectClass parent_class;
};

The class structure for KKC_TYPE_ROM_KANA_CHARACTER_LIST. All the fields in this structure are private and should never be accessed directly.

Members


KKC_TYPE_ROM_KANA_CONVERTER

#define KKC_TYPE_ROM_KANA_CONVERTER (kkc_rom_kana_converter_get_type ())

The type for KkcRomKanaConverter.


struct KkcRomKanaConverter

struct KkcRomKanaConverter;

Romaji-to-kana converter.


struct KkcRomKanaConverterClass

struct KkcRomKanaConverterClass {
	GObjectClass parent_class;
};

The class structure for KKC_TYPE_ROM_KANA_CONVERTER. All the fields in this structure are private and should never be accessed directly.

Members


enum KkcKanaMode

Type representing kana scripts.

Members

KKC_KANA_MODE_HIRAGANA

Hiragana like "あいう...".

 

KKC_KANA_MODE_KATAKANA

Katakana like "アイウ...".

 

KKC_KANA_MODE_HANKAKU_KATAKANA

Half-width katakana like "アイウ...".

 

KKC_KANA_MODE_LATIN

Half-width latin like "abc...".

 

KKC_KANA_MODE_WIDE_LATIN

Full-width latin like "abc...".

 

enum KkcPunctuationStyle

Type to specify how "." and "," are converted.

Members

KKC_PUNCTUATION_STYLE_JA_JA

Use "。" and "、" for "." and ",".

 

KKC_PUNCTUATION_STYLE_EN_EN

Use "." and "," for "." and ",".

 

KKC_PUNCTUATION_STYLE_JA_EN

Use "。" and "," for "." and ",".

 

KKC_PUNCTUATION_STYLE_EN_JA

Use "." and "、" for "." and ",".

 

struct KkcRomKanaCharacter

struct KkcRomKanaCharacter {
	gchar* output;
	gchar* input;
};

Object representing a minimal unit of a transliterated character.

Property Details

The “size” property

  “size”                     gint

The number of characters in the character list.

Flags: Read

Default value: 0


The “auto-correct” property

  “auto-correct”             gboolean

The current auto correct flag.

Flags: Read / Write

Default value: TRUE


The “kana-mode” property

  “kana-mode”                KkcKanaMode

The current kana mode.

Flags: Read / Write

Default value: KKC_KANA_MODE_HIRAGANA


The “pending-input” property

  “pending-input”            gchar *

The input being processed.

Flags: Read

Default value: NULL


The “pending-output” property

  “pending-output”           gchar *

The output being processed.

Flags: Read

Default value: NULL


The “produced” property

  “produced”                 KkcRomKanaCharacterList *

A list of already processed characters.

Flags: Read


The “punctuation-style” property

  “punctuation-style”        KkcPunctuationStyle

The current punctuation style.

Flags: Read / Write

Default value: KKC_PUNCTUATION_STYLE_JA_JA


The “rule” property

  “rule”                     KkcRomKanaMapFile *

rule.

Flags: Read / Write