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.7k Golang : Sort lines of text example
+8.8k Golang : Ordinal and Ordinalize a given number to the English ordinal numeral
+9.9k Golang : Web routing/multiplex example
+5k Golang : List all packages and search for certain package
+12.1k Golang : Get user input until a command or receive a word to stop
+8.9k Golang : Get current, epoch time and display by year, month and day
+32.4k Golang : Create x509 certificate, private and public keys
+15k Golang : Get IP addresses of a domain name
+5k Golang : Generate multiplication table from an integer example
+12.9k Golang : convert(cast) string to float value
+12.1k Golang : Count number of runes in string
+4.4k Unix/Linux : How to archive and compress entire directory ?