Compare commits
No commits in common. "4bc6eb9d41efbc2efb745391dae4375e4cba68a0" and "df743cca96d89a77501d6f7653f90789abb0bdc2" have entirely different histories.
4bc6eb9d41
...
df743cca96
@ -4,9 +4,7 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
type ArmenianTranslit struct {
|
||||
initComplete bool
|
||||
}
|
||||
type ArmenianTranslit struct{}
|
||||
|
||||
var armenianMap = []string{
|
||||
"աու", "au",
|
||||
@ -123,7 +121,6 @@ var armenianMap = []string{
|
||||
}
|
||||
|
||||
func (at *ArmenianTranslit) Init() {
|
||||
if !at.initComplete {
|
||||
lower := armenianMap
|
||||
for i, val := range lower {
|
||||
if i%2 == 1 {
|
||||
@ -134,8 +131,6 @@ func (at *ArmenianTranslit) Init() {
|
||||
armenianMap = append(armenianMap, capital, strings.Title(armenianMap[i+1]))
|
||||
}
|
||||
}
|
||||
at.initComplete = true
|
||||
}
|
||||
}
|
||||
|
||||
func (at *ArmenianTranslit) Transliterate(s string) string {
|
||||
|
@ -39,14 +39,6 @@ func (ct *ChineseTranslit) Transliterate(s string) string {
|
||||
outBuf.WriteRune(char)
|
||||
}
|
||||
}
|
||||
if tmpBuf.Len() > 0 {
|
||||
// Convert to pinyin (without tones)
|
||||
out := pinyin.LazyConvert(tmpBuf.String(), nil)
|
||||
// Write space-separated string to output
|
||||
outBuf.WriteString(strings.Join(out, " "))
|
||||
// Reset temporary buffer
|
||||
tmpBuf.Reset()
|
||||
}
|
||||
// Return output string
|
||||
return outBuf.String()
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user