Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var HE = NewRangeDictionary(0x0021, 0x007e)
HE defines the Hankaku Eisuu (i.e. half width english text) Dictionary
var HG = NewRangeDictionary(0x3041, 0x3096)
HG defines the HiraGana Dictionary
var HK = NewDictionary([]string{
"ガ", "ギ", "グ", "ゲ", "ゴ",
"ザ", "ジ", "ズ", "ゼ", "ゾ",
"ダ", "ヂ", "ヅ", "デ", "ド",
"バ", "パ", "ビ", "ピ", "ブ", "プ", "ベ", "ペ", "ボ", "ポ",
"ヷ", "ヺ", "ヴ",
"。", "「", "」", "、", "・", "ー", "゙", "゚",
"ア", "イ", "ウ", "エ", "オ",
"カ", "キ", "ク", "ケ", "コ",
"サ", "シ", "ス", "セ", "ソ", "タ", "チ", "ツ", "テ", "ト",
"ナ", "ニ", "ヌ", "ネ", "ノ",
"ハ", "ヒ", "フ", "ヘ", "ホ",
"マ", "ミ", "ム", "メ", "モ",
"ヤ", "ユ", "ヨ",
"ラ", "リ", "ル", "レ", "ロ",
"ワ", "ヲ", "ン",
"ァ", "ィ", "ゥ", "ェ", "ォ",
"ャ", "ュ", "ョ", "ッ",
})
HK defines the Hankaku Katakana (i.e. half width katakana) Dictionary
var HS = NewDictionary([]string{" ", stringify(0x00a0)})
HS defines the Hankaku Space (i.e. half width space) Dictionary
var KK = NewRangeDictionary(0x30a1, 0x30f6)
KK defines the KataKana Dictionary
var ZE = NewRangeDictionary(0xff01, 0xff5e)
ZE defines the Zenkaku Eisuu (i.e. full width english text) Dictionary
var ZK = NewDictionary([]string{
"ガ", "ギ", "グ", "ゲ", "ゴ",
"ザ", "ジ", "ズ", "ゼ", "ゾ",
"ダ", "ヂ", "ヅ", "デ", "ド",
"バ", "パ", "ビ", "ピ", "ブ", "プ", "ベ", "ペ", "ボ", "ポ",
"ヷ", "ヺ", "ヴ",
"。", "「", "」", "、", "・", "ー", "゛", "゜",
"ア", "イ", "ウ", "エ", "オ",
"カ", "キ", "ク", "ケ", "コ",
"サ", "シ", "ス", "セ", "ソ",
"タ", "チ", "ツ", "テ", "ト",
"ナ", "ニ", "ヌ", "ネ", "ノ",
"ハ", "ヒ", "フ", "ヘ", "ホ",
"マ", "ミ", "ム", "メ", "モ",
"ヤ", "ユ", "ヨ",
"ラ", "リ", "ル", "レ", "ロ",
"ワ", "ヲ", "ン",
"ァ", "ィ", "ゥ", "ェ", "ォ",
"ャ", "ュ", "ョ", "ッ",
})
ZK defines the Zenkaku Katakana (i.e. full width katakana) Dictionary
var ZS = NewDictionary([]string{stringify(0x3000), stringify(0x3000)})
ZS defines the Zenkaku Space (i.e. full width space) Dictionary
Functions ¶
func Convert ¶
func Convert(s string, from, to Dictionary) string
Convert a string between two Dictionaries
Types ¶
type Dictionary ¶
type Dictionary interface { Encode([]MaybeIndex) string Decode(string) []MaybeIndex }
Dictionary defines an interface for mapping between a string and index
func NewDictionary ¶
func NewDictionary(d []string) Dictionary
NewDictionary creates a dictionary from the given string slice
func NewRangeDictionary ¶
func NewRangeDictionary(s, e rune) Dictionary
NewRangeDictionary creates a dictionary from the given range
type MaybeIndex ¶
type MaybeIndex struct {
// contains filtered or unexported fields
}
MaybeIndex may be an index or a rune