Documentation ¶
Overview ¶
Package kanatrans converts English phrases into phonetic Japanese kana approximations; also known as Englishru
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConvertToJapanesePunctuation ¶ added in v1.0.2
Function to convert normal punctuations to their Japanese equivalents
func ConvertToJapanesePunctuationRestricted ¶ added in v1.0.2
Function to convert normal punctuations to their Japanese equivalents
Types ¶
type AllToKana ¶
type AllToKana struct {
// contains filtered or unexported fields
}
AllToKana struct holds the necessary functions for All to Katakana conversion
func NewAllToKana ¶
NewAllToKana creates a new instance of AllToKana
type EngToKana ¶
type EngToKana struct {
// contains filtered or unexported fields
}
EngToKana struct holds the necessary functions for English to Katakana conversion
func NewEngToKana ¶
NewEngToKana creates a new instance of EngToKana
func (*EngToKana) TranscriptSentence ¶
TranscriptSentence converts an English sentence to Katakana
func (*EngToKana) TranscriptWord ¶
TranscriptWord converts an English word to Katakana
type HiraganaToKana ¶ added in v1.0.1
type HiraganaToKana struct{}
HiraganaToKana struct holds the necessary functions for Hiragana to Katakana conversion
func NewHiraganaToKana ¶ added in v1.0.1
func NewHiraganaToKana() *HiraganaToKana
NewHiraganaToKana creates a new instance of HiraganaToKana
func (*HiraganaToKana) Convert ¶ added in v1.0.1
func (h2k *HiraganaToKana) Convert(input string) string
Convert converts Hiragana characters to Katakana while leaving Katakana characters unchanged
type KanjiSplitter ¶
type KanjiSplitter struct {
// contains filtered or unexported fields
}
KanjiSplitter is a class to split a string into segments of Roman, Katagana & Hiragana, and Romaji text for individual processing
func NewKanjiSplitter ¶
func NewKanjiSplitter(kanjiCallback, kanaCallback, romanCallback, punctCallback func(string) string) *KanjiSplitter
NewKanjiSplitter creates a new instance of KanjiSplitter
func (*KanjiSplitter) SeparateAndProcess ¶
func (ks *KanjiSplitter) SeparateAndProcess(input string) string
SeparateAndProcess separates the input string into segments of Roman, Katagana & Hiragana, and Romaji text, and processes each segment accordingly
type KanjiToKana ¶
type KanjiToKana struct {
// contains filtered or unexported fields
}
KanjiToKana struct holds the necessary functions for Kanji to Kana conversion
func NewKanjiToKana ¶
func NewKanjiToKana() *KanjiToKana
NewKanjiToKana creates a new instance of KanjiToKana
func (*KanjiToKana) Convert ¶
func (k2k *KanjiToKana) Convert(kanji string) string
Convert converts Kanji into Katakana
type RomajiToKana ¶
type RomajiToKana struct {
// contains filtered or unexported fields
}
RomajiToKana struct holds the necessary functions for Romaji to Kana conversion
func NewRomajiToKana ¶
func NewRomajiToKana(strictClean ...bool) *RomajiToKana
NewRomajiToKana creates a new instance of RomajiToKana
func (*RomajiToKana) Convert ¶
func (r2k *RomajiToKana) Convert(s string) string
Convert converts Romaji to Katakana