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
+7.8k Golang : Sort words with first uppercase letter
+17.4k Golang : Upload/Receive file progress indicator
+31.9k Golang : Convert []string to []byte examples
+7.1k Golang : Calculate how many weeks left to go in a given year
+3.9k Javascript : Empty an array example
+6.8k Javascript : How to get JSON data from another website with JQuery or Ajax ?
+3.1k Golang : Fix go-cron set time not working issue
+15k Golang : Get all local users and print out their home directory, description and group id
+6.7k Golang : Calculate BMI and risk category
+14k Golang : How to pass map to html template and access the map's elements
+8.6k Golang : Take screen shot of browser with JQuery example
+24.9k Golang : Generate MD5 checksum of a file