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
+16.3k Golang : How to extract links from web page ?
+10.4k Golang : Generate random integer or float number
+10.1k Golang : How to tokenize source code with text/scanner package?
+6.7k Golang : Experimental emojis or emoticons icons programming language
+9.5k Facebook : Getting the friends list with PHP return JSON format
+15.7k Golang : Get checkbox or extract multipart form data value example
+14k Golang : concatenate(combine) strings
+5.3k Golang : Get FX sentiment from website example
+8.4k Golang : Implementing class(object-oriented programming style)
+9.6k Golang : Read file with ioutil
+7.1k Nginx : How to block user agent ?
+14.2k Golang : Fix image: unknown format error