碰到诸如dongfangmingzhu这样的拼音,需要将其拆分为空格隔开的形式(dong fang ming zhu)。
第一方案想通过声母韵母的规则进行分割。但是,由于规则的整理容易遗漏,并且没有可借鉴的,所以转为通过匹配固定拼音形式的方式进行分割
从在线新华字典得到汉字拼音表,结果并不全,在调试代码的过程中,增补了一些,记录如下,如有遗漏,还请指出
public static final String aoePinyin = "a o e ai ao ou er an en ang eng";
public static final String bPinyin = "ba bo bai bei bao ban ben bang beng bi bie biao bian bin bing bu";
public static final String cPinyin = "ca cai cao can cang ce cen ceng ci cou cong cu cui cuo cun";
public static final String chPinyin = "cha chai chan chao chang che chen cheng chi chou chong chu chuo chun chuan";
public static final String dPinyin = "da de dai dei dao dou dong dan dang deng di die diao diu dian ding du dui duo dun duan";
public static final String fPinyin = "fa fo fei fou fan fen fang feng fu";
public static final String gPinyin = "ga ge gai gei gao gou gan gen gang geng gong gu gua gui guo guai guan guang";
public static final String hPinyin = "ha hai hao han hang he hei hen heng hou hong hu hua hui huo huai huan huang";
public static final String jPinyin = "ji jia jie jiao jiu jian jin jiang jing ju jue jun juan";
public static final String kPinyin = "ka kao kai kan kang ke ken keng kou kong ku kua kuo kun kuan kuang";
public static final String lPinyin = "la le lai lei lao lou lan lang leng long li lia lie liao liu lian lin liang ling lu lun luo luan lv";
public static final String mPinyin = "ma mo me mei mu mai mao mou man men mang meng mi mie miao miu mian min ming";
public static final String nPinyin = "na nai nei nao nong nan nen nang neng ni nie niao niu nian nin niang ning nu nv";
public static final String pPinyin = "pa pai pao pan pang po pou pu pei pen peng pi pie piao pian pin ping";
public static final String qPinyin = "qi qia qie qiao qiu qian qin qiang qing qu que qun quan";
public static final String rPinyin = "rao re ri rou rong ran ren rang reng ru rui ruo";
public static final String sPinyin = "sa se si sai sao sou san sen sang seng song su sui suo sun";
public static final String shPinyin = "sha she shi shai shao shou shan shen shang sheng shu shua shui shuo shun shuan shuang";
public static final String tPinyin = "ta te tai tao tou tong tan tang teng ti tie tiao tian ting tu tui tuo tuan";
public static final String wPinyin = "wa wo wai wei wan wen wang weng wu";
public static final String yPinyin = "ya yao you yong yan yang ye yue yuan yi yin ying yu yun";
public static final String xPinyin = "xi xia xie xiao xiu xian xin xing xiang xiong xu xue xun xuan";
public static final String zPinyin = "za zai zao zang ze zi zou zong zui zeng zu zun zuo zuan";
public static final String zhPinyin = "zha zhe zhi zhai zhao zhou zhong zhan zhen zhang zheng zhu zhua zhuan zhuang";