Golang : Convert Chinese UTF8 characters to Pin Yin
Not really a tutorial, but putting this here in case I need to refer back again in future. Here is a list of Golang packages that can convert UTF8 Chinese characters into romanized characters or Pin Yin.
https://github.com/axgle/pinyin
and
https://github.com/mozillazg/go-pinyin
For the dictionary, see here https://github.com/mozillazg/go-pinyin/blob/master/pinyin_dict.go
Here is what these packages can do:
$ pinyin 中国人
zhōng guó rén
See also : Golang : How to print rune, unicode, utf-8 and non-ASCII CJK(Chinese/Japanese/Korean) characters?
By Adam Ng
IF you gain some knowledge or the information here solved your programming problem. Please consider donating to the less fortunate or some charities that you like. Apart from donation, planting trees, volunteering or reducing your carbon footprint will be great too.
Advertisement
Tutorials
+10.6k Golang : Create Temporary File
+6.9k Golang : Accessing dataframe-go element by row, column and name example
+25.3k Golang : missing Mercurial command
+7k Golang : Create zip/ePub file without compression(use Store algorithm)
+12.5k Golang : Convert int(year) to time.Time type
+41k Golang : Convert string to array/slice
+8.7k Golang : io.Reader causing panic: runtime error: invalid memory address or nil pointer dereference
+17.4k Golang : Login and logout a user after password verification and redirect example
+24k Golang : GORM read from database example
+4.7k Python : Convert(cast) bytes to string example
+5.6k Facebook : How to force facebook to scrape latest URL link data?
+7.2k Golang : Shuffle strings array