예제 #1
0
func TestExamplePinyin_finals(t *testing.T) {
	hans := "中国人"
	a := pinyin.NewArgs()
	a.Style = pinyin.Finals
	t.Log(pinyin.Pinyin(hans, a))
	// Output: [[ong] [uo] [en]]
}
예제 #2
0
func TestExamplePinyin_finalsTone2(t *testing.T) {
	hans := "中国人"
	a := pinyin.NewArgs()
	a.Style = pinyin.FinalsTone2
	t.Log(pinyin.Pinyin(hans, a))
	// Output: [[o1ng] [uo2] [e2n]]
}
예제 #3
0
func TestExamplePinyin_finalsTone(t *testing.T) {
	hans := "中国人"
	a := pinyin.NewArgs()
	a.Style = pinyin.FinalsTone
	t.Log(pinyin.Pinyin(hans, a))
	// Output: [[ōng] [uó] [én]]
}
예제 #4
0
func TestExamplePinyin_firstLetter(t *testing.T) {
	hans := "中国人"
	a := pinyin.NewArgs()
	a.Style = pinyin.FirstLetter
	t.Log(pinyin.Pinyin(hans, a))
	// Output: [[z] [g] [r]]
}
예제 #5
0
func TestExamplePinyin_initials(t *testing.T) {
	hans := "中国人"
	a := pinyin.NewArgs()
	a.Style = pinyin.Initials
	t.Log("Initials:", pinyin.Pinyin(hans, a))
	// Output: Initials: [[zh] [g] [r]]
}
예제 #6
0
func TestExamplePinyin_tone2(t *testing.T) {
	hans := "中国人"
	a := pinyin.NewArgs()
	a.Style = pinyin.Tone2
	t.Log("Tone2:", pinyin.Pinyin(hans, a))
	// Output: Tone2: [[zho1ng] [guo2] [re2n]]
}
예제 #7
0
func TestExamplePinyin_tone(t *testing.T) {
	hans := "中国人"
	a := pinyin.NewArgs()
	a.Style = pinyin.Tone
	t.Log("Tone:", pinyin.Pinyin(hans, a))
	// Output: Tone: [[zhōng] [guó] [rén]]
}
예제 #8
0
func TestExamplePinyin_normal(t *testing.T) {
	hans := "中国人"
	a := pinyin.NewArgs()
	a.Style = pinyin.Normal
	t.Log("Normal:", pinyin.Pinyin(hans, a))
	// Output: Normal: [[zhong] [guo] [ren]]
}
예제 #9
0
func TestExamplePinyin_heteronym(t *testing.T) {
	hans := "中国人"
	a := pinyin.NewArgs()
	a.Heteronym = true
	a.Style = pinyin.Tone2
	t.Log(pinyin.Pinyin(hans, a))
	// Output: [[zho1ng zho4ng] [guo2] [re2n]]
}
예제 #10
0
func TestExampleSlug(t *testing.T) {
	hans := "中国人"
	a := pinyin.NewArgs()
	t.Log(pinyin.Slug(hans, a))
	// Output: zhong-guo-ren
}
예제 #11
0
func TestExampleLazyPinyin(t *testing.T) {
	hans := "中国人"
	a := pinyin.NewArgs()
	t.Log(pinyin.LazyPinyin(hans, a))
	// Output: [zhong guo ren]
}
예제 #12
0
func TestExamplePinyin_default(t *testing.T) {
	hans := "中国人"
	a := pinyin.NewArgs()
	t.Log("default:", pinyin.Pinyin(hans, a))
	// Output: default: [[zhong] [guo] [ren]]
}