class

Zh2Vi::Dict::HanViet

Inherits Reference < Object

HanViet converts Chinese characters to Sino-Vietnamese (Hán-Việt) readings Used for OOV (Out-of-Vocabulary) words, especially proper nouns

Constructors

default

Create with common Sino-Vietnamese mappings (built-in fallback)

Source
load(path : String) : HanViet

Load from file: each line is "char reading" or "char\treading"

Source

Instance methods

add(char : Char, reading : String) : Nil
Source
convert(text : String) : String

Convert a string of Chinese characters to Sino-Vietnamese Unknown characters are kept as-is

Source
convert_char(char : Char) : String | Nil

Convert a single character

Source
convert_proper(text : String) : String

Convert for proper nouns (all words capitalized)

Source
has_key?(char : Char) : Bool
Source
size
Source