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
+38.4k Golang : How to check if a string contains another sub-string?
+20.5k Golang : Record voice(audio) from microphone to .WAV file
+7.4k Golang : Get current, epoch time and display by year, month and day
+8k Golang : Remove or trim extra comma from CSV
+22.9k Golang : Detect (OS) Operating System
+12.8k Golang : read gzipped http response
+11k Golang : How to reverse elements order in map ?
+3.2k PHP : Hide PHP version information from curl
+3.6k Golang : Reclaim memory occupied by make() example
+7.9k Golang : How to flush a channel before the end of program?
+6.2k Mac OSX : Get a process/daemon status information
+10.3k Golang : How to check if IP address is in range