Example usage:
chungmcl@mac ~ % zh 你好嗎
你 nǐ nei5
好 hǎo hou2:hou3
嗎 ma maa1:maa3
On macOS, use --cantonese/-c/c or --mandarin/-m/m as an argument after your input to have zh pronounce your input for you.
For instance:
chungmcl@mac ~ % zh 你好嗎 c
你 nǐ nei5
好 hǎo hou2:hou3
嗎 ma maa1:maa3
should audibly play the pronunciation out in Cantonese for you.
For longer inputs, you can use multi-line mode:
chungmcl@mac ~ % zh
[return + CTRL + D] to finish input, [CTRL + D] to exit.
Input:
今天我
寒夜裡看雪飄過
今 jīn gam1
天 tiān tin1
我 wǒ ngo5
寒 hán hon4
夜 yè je6:je2
裡 lǐ leoi5:lei1
看 kàn hon3:hon1
雪 xuě syut3:syut1:syut2:syut4
飄 piāo piu1:peu1
過 guò gwo3:go4:gwo4:gwo2
[return + CTRL + D] to finish input, [CTRL + D] to exit.
Input: