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
+12.1k Golang : error parsing regexp: invalid or unsupported Perl syntax
+4.8k Golang : Use NLP to get sentences for each paragraph example
+26.6k Golang : Change a file last modified date and time
+7.8k Golang : Simple histogram example
+22.2k Golang : Print out struct values in string format
+9.5k Golang : How to unmarshal JSON inner/nested value and assign to specific struct?
+38.1k Golang : UDP client server read write example
+23.4k Golang : Change file read or write permission example
+10.2k Golang : Post data with url.Values{}
+4.3k Gogland : Datasource explorer
+61.4k Golang : Convert HTTP Response body to string
+9.6k Golang : Get local time and equivalent time in different time zone