<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">package bopomofo;

use strict;
use warnings;
use utf8;
use Exporter;



#Copyright (c) 2004 Jason Toy(æœ±ä»²å…‰  &lt;toy@cpan.org&gt;
#This module is under the BSD license

our @ISA = qw(Exporter);
our $VERSION = '0.01';
our @EXPORT_OK = qw(&amp;bopo_to_pin);
our %Map;

sub bopo_to_pin {
    my ($text) = @_;
    $text =~ s/(\S)/ defined $Map{$1} ? $Map{$1} : $1; /eg;
    return $text;
}



%Map =
('ã„š' =&gt; 'a', 'ã„ž' =&gt; 'ai', 'ã„¢' =&gt; 'an', 
'ã„¤' =&gt; 'ang', 'ã„&nbsp;' =&gt; 'ao', 'ã„…ã„š' =&gt; 'ba', 
'ã„…ã„ž' =&gt; 'bai', 'ã„…ã„¢' =&gt; 'ban', 'ã„…ã„¤' =&gt; 'bang', 
'ã„…ã„&nbsp;' =&gt; 'bao', 'ã„…ã„Ÿ' =&gt; 'bei', 'ã„…ã„£' =&gt; 'ben', 
'ã„…ã„¥' =&gt; 'beng', 'ã„…ã„§' =&gt; 'bi', 'ã„…ã„§ã„¢' =&gt; 'bian', 
'ã„…ã„§ã„&nbsp;' =&gt; 'biao', 'ã„…ã„§ã„' =&gt; 'bie', 'ã„…ã„§ã„£' =&gt; 'bin', 
'ã„…ã„§ã„¥' =&gt; 'bing', 'ã„…ã„›' =&gt; 'bo', 'ã„…ã„¨' =&gt; 'bu', 
'ã„˜ã„š' =&gt; 'ca', 'ã„˜ã„ž' =&gt; 'cai', 'ã„˜ã„¢' =&gt; 'can', 
'ã„˜ã„¤' =&gt; 'cang', 'ã„˜ã„&nbsp;' =&gt; 'cao', 'ã„˜ã„œ' =&gt; 'ce', 
'ã„˜ã„£' =&gt; 'cen', 'ã„˜ã„¥' =&gt; 'ceng', 'ã„”ã„š' =&gt; 'cha', 
'ã„”ã„ž' =&gt; 'chai', 'ã„”ã„¢' =&gt; 'chan', 'ã„”ã„¤' =&gt; 'chang', 
'ã„”ã„&nbsp;' =&gt; 'chao', 'ã„”ã„œ' =&gt; 'che', 'ã„”ã„£' =&gt; 'chen', 
'ã„”ã„¥' =&gt; 'cheng', 'ã„”' =&gt; 'chi', 'ã„”ã„¨ã„¥' =&gt; 'chong', 
'ã„”ã„¡' =&gt; 'chou', 'ã„”ã„¨' =&gt; 'chu', 'ã„”ã„¨ã„ž' =&gt; 'chuai', 
'ã„”ã„¨ã„¢' =&gt; 'chuan', 'ã„”ã„¨ã„¤' =&gt; 'chuang', 'ã„”ã„¨ã„Ÿ' =&gt; 'chui', 
'ã„”ã„¨ã„£' =&gt; 'chun', 'ã„”ã„¨ã„›' =&gt; 'chuo', 'ã„˜' =&gt; 'ci', 
'ã„˜ã„¨ã„¥' =&gt; 'cong', 'ã„˜ã„¨' =&gt; 'cu', 'ã„˜ã„¨ã„¢' =&gt; 'cuan', 
'ã„˜ã„¨ã„Ÿ' =&gt; 'cui', 'ã„˜ã„¨ã„£' =&gt; 'cun', 'ã„˜ã„¨ã„›' =&gt; 'cuo', 
'ã„‰ã„š' =&gt; 'da', 'ã„‰ã„ž' =&gt; 'dai', 'ã„‰ã„¢' =&gt; 'dan', 
'ã„‰ã„¤' =&gt; 'dang', 'ã„‰ã„&nbsp;' =&gt; 'dao', 'ã„‰ã„œ' =&gt; 'de', 
'ã„‰ã„Ÿ' =&gt; 'dei', 'ã„‰ã„¥' =&gt; 'deng', 'ã„‰ã„§' =&gt; 'di', 
'ã„‰ã„§ã„¢' =&gt; 'dian', 'ã„‰ã„§ã„&nbsp;' =&gt; 'diao', 'ã„‰ã„§ã„' =&gt; 'die', 
'ã„‰ã„§ã„¥' =&gt; 'ding', 'ã„‰ã„§ã„¡' =&gt; 'diu', 'ã„‰ã„¨ã„¥' =&gt; 'dong', 
'ã„‰ã„¡' =&gt; 'dou', 'ã„‰ã„¨' =&gt; 'du', 'ã„‰ã„¨ã„¢' =&gt; 'duan', 
'ã„‰ã„¨ã„Ÿ' =&gt; 'dui', 'ã„‰ã„¨ã„£' =&gt; 'dun', 'ã„‰ã„¨ã„›' =&gt; 'duo', 
'ã„' =&gt; 'e', 'ã„œ' =&gt; 'e', 'ã„Ÿ' =&gt; 'ei', 
'ã„£' =&gt; 'en', 'ã„¥' =&gt; 'eng', 'ã„¦' =&gt; 'er', 
'ã„ˆã„š' =&gt; 'fa', 'ã„ˆã„¢' =&gt; 'fan', 'ã„ˆã„¤' =&gt; 'fang', 
'ã„ˆã„Ÿ' =&gt; 'fei', 'ã„ˆã„£' =&gt; 'fen', 'ã„ˆã„¥' =&gt; 'feng', 
'ã„ˆã„›' =&gt; 'fo', 'ã„ˆã„¡' =&gt; 'fou', 'ã„ˆã„¨' =&gt; 'fu', 
'ã„ã„š' =&gt; 'ga', 'ã„ã„ž' =&gt; 'gai', 'ã„ã„¢' =&gt; 'gan', 
'ã„ã„¤' =&gt; 'gang', 'ã„ã„&nbsp;' =&gt; 'gao', 'ã„ã„œ' =&gt; 'ge', 
'ã„ã„Ÿ' =&gt; 'gei', 'ã„ã„£' =&gt; 'gen', 'ã„ã„¥' =&gt; 'geng', 
'ã„ã„¨ã„¥' =&gt; 'gong', 'ã„ã„¡' =&gt; 'gou', 'ã„ã„¨' =&gt; 'gu', 
'ã„ã„¨ã„š' =&gt; 'gua', 'ã„ã„¨ã„ž' =&gt; 'guai', 'ã„ã„¨ã„¢' =&gt; 'guan', 
'ã„ã„¨ã„¤' =&gt; 'guang', 'ã„ã„¨ã„Ÿ' =&gt; 'gui', 'ã„ã„¨ã„£' =&gt; 'gun', 
'ã„ã„¨ã„›' =&gt; 'guo', 'ã„ã„š' =&gt; 'ha', 'ã„ã„ž' =&gt; 'hai', 
'ã„ã„¢' =&gt; 'han', 'ã„ã„¤' =&gt; 'hang', 'ã„ã„&nbsp;' =&gt; 'hao', 
'ã„ã„œ' =&gt; 'he', 'ã„ã„Ÿ' =&gt; 'hei', 'ã„ã„£' =&gt; 'hen', 
'ã„ã„¥' =&gt; 'heng', 'ã„ã„¨ã„¥' =&gt; 'hong', 'ã„ã„¡' =&gt; 'hou', 
'ã„ã„¨' =&gt; 'hu', 'ã„ã„¨ã„š' =&gt; 'hua', 'ã„ã„¨ã„ž' =&gt; 'huai', 
'ã„ã„¨ã„¢' =&gt; 'huan', 'ã„ã„¨ã„¤' =&gt; 'huang', 'ã„ã„¨ã„Ÿ' =&gt; 'hui', 
'ã„ã„¨ã„£' =&gt; 'hun', 'ã„ã„¨ã„›' =&gt; 'huo', 'ã„ã„§' =&gt; 'ji', 
'ã„ã„§ã„š' =&gt; 'jia', 'ã„ã„§ã„¢' =&gt; 'jian', 'ã„ã„§ã„¤' =&gt; 'jiang', 
'ã„ã„§ã„&nbsp;' =&gt; 'jiao', 'ã„ã„§ã„' =&gt; 'jie', 'ã„ã„§ã„£' =&gt; 'jin', 
'ã„ã„§ã„¥' =&gt; 'jing', 'ã„ã„©ã„¥' =&gt; 'jiong', 'ã„ã„§ã„¡' =&gt; 'jiu', 
'ã„ã„©' =&gt; 'ju', 'ã„ã„©ã„¢' =&gt; 'juan', 'ã„ã„©ã„' =&gt; 'jue', 
'ã„ã„©ã„£' =&gt; 'jun', 'ã„Žã„š' =&gt; 'ka', 'ã„Žã„ž' =&gt; 'kai', 
'ã„Žã„¢' =&gt; 'kan', 'ã„Žã„¤' =&gt; 'kang', 'ã„Žã„&nbsp;' =&gt; 'kao', 
'ã„Žã„œ' =&gt; 'ke', 'ã„Žã„£' =&gt; 'ken', 'ã„Žã„¥' =&gt; 'keng', 
'ã„Žã„¨ã„¥' =&gt; 'kong', 'ã„Žã„¡' =&gt; 'kou', 'ã„Žã„¨' =&gt; 'ku', 
'ã„Žã„¨ã„š' =&gt; 'kua', 'ã„Žã„¨ã„ž' =&gt; 'kuai', 'ã„Žã„¨ã„¢' =&gt; 'kuan', 
'ã„Žã„¨ã„¤' =&gt; 'kuang', 'ã„Žã„¨ã„Ÿ' =&gt; 'kui', 'ã„Žã„¨ã„£' =&gt; 'kun', 
'ã„Žã„¨ã„›' =&gt; 'kuo', 'ã„Œã„š' =&gt; 'la', 'ã„Œã„ž' =&gt; 'lai', 
'ã„Œã„¢' =&gt; 'lan', 'ã„Œã„¤' =&gt; 'lang', 'ã„Œã„&nbsp;' =&gt; 'lao', 
'ã„Œã„œ' =&gt; 'le', 'ã„Œã„Ÿ' =&gt; 'lei', 'ã„Œã„¥' =&gt; 'leng', 
'ã„Œã„§' =&gt; 'li', 'ã„Œã„§ã„š' =&gt; 'lia', 'ã„Œã„§ã„¢' =&gt; 'lian', 
'ã„Œã„§ã„¤' =&gt; 'liang', 'ã„Œã„§ã„&nbsp;' =&gt; 'liao', 'ã„Œã„§ã„' =&gt; 'lie', 
'ã„Œã„§ã„£' =&gt; 'lin', 'ã„Œã„§ã„¥' =&gt; 'ling', 'ã„Œã„§ã„¡' =&gt; 'liu', 
'ã„Œã„¨ã„¥' =&gt; 'long', 'ã„Œã„¡' =&gt; 'lou', 'ã„Œã„¨' =&gt; 'lu', 
'ã„Œã„¨ã„¢' =&gt; 'luan', 'ã„Œã„©ã„' =&gt; 'lue:', 'ã„Œã„¨ã„£' =&gt; 'lun', 
'ã„Œã„¨ã„›' =&gt; 'luo', 'ã„‡ã„š' =&gt; 'ma', 'ã„‡ã„ž' =&gt; 'mai', 
'ã„‡ã„¢' =&gt; 'man', 'ã„‡ã„¤' =&gt; 'mang', 'ã„‡ã„&nbsp;' =&gt; 'mao', 
'ã„‡ã„Ÿ' =&gt; 'mei', 'ã„‡ã„£' =&gt; 'men', 'ã„‡ã„¥' =&gt; 'meng', 
'ã„‡ã„§' =&gt; 'mi', 'ã„‡ã„§ã„¢' =&gt; 'mian', 'ã„‡ã„§ã„&nbsp;' =&gt; 'miao', 
'ã„‡ã„§ã„' =&gt; 'mie', 'ã„‡ã„§ã„£' =&gt; 'min', 'ã„‡ã„§ã„¥' =&gt; 'ming', 
'ã„‡ã„§ã„¡' =&gt; 'miu', 'ã„‡ã„›' =&gt; 'mo', 'ã„‡ã„¡' =&gt; 'mou', 
'ã„‡ã„¨' =&gt; 'mu', 'ã„‹ã„š' =&gt; 'na', 'ã„‹ã„ž' =&gt; 'nai', 
'ã„‹ã„¢' =&gt; 'nan', 'ã„‹ã„¤' =&gt; 'nang', 'ã„‹ã„&nbsp;' =&gt; 'nao', 
'ã„‹ã„Ÿ' =&gt; 'nei', 'ã„‹ã„¥' =&gt; 'neng', 'ã„‹ã„§' =&gt; 'ni', 
'ã„‹ã„§ã„¢' =&gt; 'nian', 'ã„‹ã„§ã„¤' =&gt; 'niang', 'ã„‹ã„§ã„&nbsp;' =&gt; 'niao', 
'ã„‹ã„§ã„' =&gt; 'nie', 'ã„‹ã„§ã„£' =&gt; 'nin', 'ã„‹ã„§ã„¥' =&gt; 'ning', 
'ã„‹ã„§ã„¡' =&gt; 'niu', 'ã„‹ã„¨ã„¥' =&gt; 'nong', 'ã„‹ã„¨ã„¡' =&gt; 'nou', 
'ã„‹ã„¨' =&gt; 'nu', 'ã„‹ã„©' =&gt; 'nu:', 'ã„‹ã„¨ã„¢' =&gt; 'nuan', 
'ã„‹ã„©ã„' =&gt; 'nue:', 'ã„‹ã„¨ã„›' =&gt; 'nuo', 'ã„¡' =&gt; 'ou', 
'ã„†ã„š' =&gt; 'pa', 'ã„†ã„ž' =&gt; 'pai', 'ã„†ã„¢' =&gt; 'pan', 
'ã„†ã„¤' =&gt; 'pang', 'ã„†ã„&nbsp;' =&gt; 'pao', 'ã„†ã„Ÿ' =&gt; 'pei', 
'ã„†ã„£' =&gt; 'pen', 'ã„†ã„¥' =&gt; 'peng', 'ã„†ã„§' =&gt; 'pi', 
'ã„†ã„§ã„¢' =&gt; 'pian', 'ã„†ã„§ã„&nbsp;' =&gt; 'piao', 'ã„†ã„§ã„' =&gt; 'pie', 
'ã„†ã„§ã„£' =&gt; 'pin', 'ã„†ã„§ã„¥' =&gt; 'ping', 'ã„†ã„›' =&gt; 'po', 
'ã„†ã„¡' =&gt; 'pou', 'ã„†ã„¨' =&gt; 'pu', 'ã„‘ã„§' =&gt; 'qi', 
'ã„‘ã„§ã„š' =&gt; 'qia', 'ã„‘ã„§ã„¢' =&gt; 'qian', 'ã„‘ã„§ã„¤' =&gt; 'qiang', 
'ã„‘ã„§ã„&nbsp;' =&gt; 'qiao', 'ã„‘ã„§ã„' =&gt; 'qie', 'ã„‘ã„§ã„£' =&gt; 'qin', 
'ã„‘ã„§ã„¥' =&gt; 'qing', 'ã„‘ã„©ã„¥' =&gt; 'qiong', 'ã„‘ã„§ã„¡' =&gt; 'qiu', 
'ã„‘ã„©' =&gt; 'qu', 'ã„‘ã„©ã„¢' =&gt; 'quan', 'ã„‘ã„©ã„' =&gt; 'que', 
'ã„‘ã„©ã„£' =&gt; 'qun', 'ã„–ã„¢' =&gt; 'ran', 'ã„–ã„¤' =&gt; 'rang', 
'ã„–ã„&nbsp;' =&gt; 'rao', 'ã„–ã„œ' =&gt; 're', 'ã„–ã„£' =&gt; 'ren', 
'ã„–ã„¥' =&gt; 'reng', 'ã„–' =&gt; 'ri', 'ã„–ã„¨ã„¥' =&gt; 'rong', 
'ã„–ã„¡' =&gt; 'rou', 'ã„–ã„¨' =&gt; 'ru', 'ã„–ã„¨ã„¢' =&gt; 'ruan', 
'ã„–ã„¨ã„Ÿ' =&gt; 'rui', 'ã„–ã„¨ã„£' =&gt; 'run', 'ã„–ã„¨ã„›' =&gt; 'ruo', 
'ã„™ã„š' =&gt; 'sa', 'ã„™ã„ž' =&gt; 'sai', 'ã„™ã„¢' =&gt; 'san', 
'ã„™ã„¤' =&gt; 'sang', 'ã„™ã„&nbsp;' =&gt; 'sao', 'ã„™ã„œ' =&gt; 'se', 
'ã„™ã„£' =&gt; 'sen', 'ã„™ã„¥' =&gt; 'seng', 'ã„•ã„š' =&gt; 'sha', 
'ã„•ã„ž' =&gt; 'shai', 'ã„•ã„¢' =&gt; 'shan', 'ã„•ã„¤' =&gt; 'shang', 
'ã„•ã„&nbsp;' =&gt; 'shao', 'ã„•ã„œ' =&gt; 'she', 'ã„•ã„Ÿ' =&gt; 'shei', 
'ã„•ã„£' =&gt; 'shen', 'ã„•ã„¥' =&gt; 'sheng', 'ã„•' =&gt; 'shi', 
'ã„•ã„¡' =&gt; 'shou', 'ã„•ã„¨' =&gt; 'shu', 'ã„•ã„¨ã„š' =&gt; 'shua', 
'ã„•ã„¨ã„ž' =&gt; 'shuai', 'ã„•ã„¨ã„¢' =&gt; 'shuan', 'ã„•ã„¨ã„¤' =&gt; 'shuang', 
'ã„•ã„¨ã„Ÿ' =&gt; 'shui', 'ã„•ã„¨ã„£' =&gt; 'shun', 'ã„•ã„¨ã„›' =&gt; 'shuo', 
'ã„™' =&gt; 'si', 'ã„™ã„¨ã„¥' =&gt; 'song', 'ã„™ã„¡' =&gt; 'sou', 
'ã„™ã„¨' =&gt; 'su', 'ã„™ã„¨ã„¢' =&gt; 'suan', 'ã„™ã„¨ã„Ÿ' =&gt; 'sui', 
'ã„™ã„¨ã„£' =&gt; 'sun', 'ã„™ã„¨ã„›' =&gt; 'suo', 'ã„‰ã„š' =&gt; 'ta', 
'ã„Šã„ž' =&gt; 'tai', 'ã„Šã„¢' =&gt; 'tan', 'ã„Šã„¤' =&gt; 'tang', 
'ã„Šã„&nbsp;' =&gt; 'tao', 'ã„Šã„œ' =&gt; 'te', 'ã„Šã„¥' =&gt; 'teng', 
'ã„Šã„§' =&gt; 'ti', 'ã„Šã„§ã„¢' =&gt; 'tian', 'ã„Šã„§ã„&nbsp;' =&gt; 'tiao', 
'ã„Šã„§ã„' =&gt; 'tie', 'ã„Šã„§ã„¥' =&gt; 'ting', 'ã„Šã„¨ã„¥' =&gt; 'tong', 
'ã„Šã„¡' =&gt; 'tou', 'ã„Šã„¨' =&gt; 'tu', 'ã„Šã„¨ã„¢' =&gt; 'tuan', 
'ã„Šã„¨ã„Ÿ' =&gt; 'tui', 'ã„Šã„¨ã„£' =&gt; 'tun', 'ã„Šã„¨ã„›' =&gt; 'tuo', 
'ã„¨ã„š' =&gt; 'wa', 'ã„¨ã„ž' =&gt; 'wai', 'ã„¨ã„¢' =&gt; 'wan', 
'ã„¨ã„¤' =&gt; 'wang', 'ã„¨ã„Ÿ' =&gt; 'wei', 'ã„¨ã„£' =&gt; 'wen', 
'ã„¨ã„¥' =&gt; 'weng', 'ã„¨ã„›' =&gt; 'wo', 'ã„¨' =&gt; 'wu', 
'ã„’ã„§' =&gt; 'xi', 'ã„’ã„§ã„š' =&gt; 'xia', 'ã„’ã„§ã„¢' =&gt; 'xian', 
'ã„’ã„§ã„¤' =&gt; 'xiang', 'ã„’ã„§ã„&nbsp;' =&gt; 'xiao', 'ã„’ã„§ã„' =&gt; 'xie', 
'ã„’ã„§ã„£' =&gt; 'xin', 'ã„’ã„§ã„¥' =&gt; 'xing', 'ã„’ã„©ã„¥' =&gt; 'xiong', 
'ã„’ã„§ã„¡' =&gt; 'xiu', 'ã„’ã„©' =&gt; 'xu', 'ã„’ã„©ã„¢' =&gt; 'xuan', 
'ã„’ã„©ã„' =&gt; 'xue', 'ã„’ã„©ã„£' =&gt; 'xun', 'ã„§ã„š' =&gt; 'ya', 
'ã„§ã„¢' =&gt; 'yan', 'ã„§ã„¤' =&gt; 'yang', 'ã„§ã„&nbsp;' =&gt; 'yao', 
'ã„§ã„' =&gt; 'ye', 'ã„§' =&gt; 'yi', 'ã„§ã„£' =&gt; 'yin', 
'ã„§ã„¥' =&gt; 'ying', 'ã„©ã„¥' =&gt; 'yong', 'ã„§ã„¡' =&gt; 'you', 
'ã„©' =&gt; 'yu', 'ã„©ã„¢' =&gt; 'yuan', 'ã„©ã„' =&gt; 'yue', 
'ã„©ã„£' =&gt; 'yun', 'ã„—ã„š' =&gt; 'za', 'ã„—ã„ž' =&gt; 'zai', 
'ã„—ã„¢' =&gt; 'zan', 'ã„—ã„¤' =&gt; 'zang', 'ã„—ã„&nbsp;' =&gt; 'zao', 
'ã„—ã„œ' =&gt; 'ze', 'ã„—ã„Ÿ' =&gt; 'zei', 'ã„—ã„£' =&gt; 'zen', 
'ã„—ã„¥' =&gt; 'zeng', 'ã„“ã„š' =&gt; 'zha', 'ã„“ã„ž' =&gt; 'zhai', 
'ã„“ã„¢' =&gt; 'zhan', 'ã„“ã„¤' =&gt; 'zhang', 'ã„“ã„&nbsp;' =&gt; 'zhao', 
'ã„“ã„œ' =&gt; 'zhe', 'ã„“ã„£' =&gt; 'zhen', 'ã„“ã„¥' =&gt; 'zheng', 
'ã„“' =&gt; 'zhi', 'ã„“ã„¨ã„¥' =&gt; 'zhong', 'ã„“ã„¡' =&gt; 'zhou', 
'ã„“ã„¨' =&gt; 'zhu', 'ã„“ã„¨ã„š' =&gt; 'zhua', 'ã„“ã„¨ã„ž' =&gt; 'zhuai', 
'ã„“ã„¨ã„¢' =&gt; 'zhuan', 'ã„“ã„¨ã„¤' =&gt; 'zhuang', 'ã„“ã„¨ã„Ÿ' =&gt; 'zhui', 
'ã„“ã„¨ã„£' =&gt; 'zhun', 'ã„“ã„¨ã„›' =&gt; 'zhuo', 'ã„—' =&gt; 'zi', 
'ã„—ã„¨ã„¥' =&gt; 'zong', 'ã„—ã„¡' =&gt; 'zou', 'ã„—ã„¨' =&gt; 'zu', 
'ã„—ã„¨ã„¢' =&gt; 'zuan', 'ã„—ã„¨ã„Ÿ' =&gt; 'zui', 'ã„—ã„¨ã„£' =&gt; 'zun',
'ã„—ã„¨ã„›' =&gt; 'zuo');


__END__


=head1 NAME

bopomofo - Convert both ways from Pinyin to bopomofo

=head1 SYNOPSIS

	use bopomofo;
	my $pinyin = bopo_to_pin($bopo);

=head1 METHODS

=over 4

=item C&lt;bopo_to_simp($text)&gt;

A map of pinyin sounds to Taiwanese bopomofo (zhuyin) sounds. 

=back

=head1 AUTHOR

Jason Toy (æœ±ä»²å…‰) E&lt;lt&gt;toy@cpan.org&lt;gt&gt;

=head1 LICENSE

Copyright (C) 2004 Jason Toy (æœ±ä»²å…‰) . This is censed under theBSD license.

=head1 SEE ALSO

http://jtoy.net/program/perl/

=cut
</pre></body></html>