Android examples for Internationalization:Pinyin
Check if the Chinese char has polyphony as a family name.
/*/*from w w w .j a va 2s .c o m*/ * Copyright (C) 2014 The Smartisan Open Source Project * This code has been modified. Portions copyright (C) 2014, Smartisan Technology Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ //package com.java2s; import java.util.HashMap; public class Main { private static HashMap<Character, String[]> mFamilyNamePolyphonyMap = new HashMap<Character, String[]>() { { put('\u79cd', new String[] { "ZHONG", "CHONG" }); // put('\u8c0c', new String[] { "CHEN", "SHEN" }); // put('\u76d6', new String[] { "GE", "GAI" }); // put('\u90c7', new String[] { "HUAN", "XUN" }); // put('\u8983', new String[] { "QIN", "TAN" }); // put('\u5355', new String[] { "DAN", "SHAN" }); // put('\u53ec', new String[] { "ZHAO", "SHAO" }); // put('\u851a', new String[] { "YU", "WEI" }); // put('\u9697', new String[] { "WEI", "KUI" }); // put('\u90d7', new String[] { "XI", "CHI" }); // put('\u89e3', new String[] { "XIE", "JIE" }); // put('\u4e50', new String[] { "YUE", "LE" }); // put('\u7fdf', new String[] { "ZHAI", "DI" }); // put('\u67e5', new String[] { "ZHA", "CHA" }); // put('\u963f', new String[] { "A", "E" }); // put('\u827e', new String[] { "AI", "YI" }); // put('\u66b4', new String[] { "BAO", "PU" }); // put('\u4fbf', new String[] { "BIAN", "PIAN" }); // put('\u85cf', new String[] { "CANG", "ZANG" }); // put('\u66fe', new String[] { "CENG", "ZENG" }); // put('\u671d', new String[] { "CHAO", "ZHAO" }); // put('\u8f66', new String[] { "CHE", "JU" }); // put('\u76db', new String[] { "CHENG", "SHENG" }); // put('\u4ec7', new String[] { "CHOU", "QIU" }); // put('\u4f20', new String[] { "CHUAN", "ZHUAN" }); // put('\u63d0', new String[] { "DI", "TI" }); // put('\u4e01', new String[] { "DING", "ZHENG" }); // put('\u800f', new String[] { "ER", "NAI" }); // put('\u7e41', new String[] { "FAN", "PO" }); // put('\u9022', new String[] { "FENG", "PANG" }); // put('\u51af', new String[] { "FENG", "PING" }); // put('\u5408', new String[] { "GE", "HE" }); // put('\u5e7f', new String[] { "GUANG", "AN" }); // put('\u7085', new String[] { "GUI", "JIONG" }); // put('\u4f1a', new String[] { "HUI", "KUAI" }); // put('\u5947', new String[] { "JI", "QI" }); // put('\u8d3e', new String[] { "JIA", "GU" }); // put('\u89c1', new String[] { "JIAN", "XIAN" }); // put('\u5c06', new String[] { "JIANG", "QIANG" }); // put('\u964d', new String[] { "JIANG", "XIANG" }); // put('\u7f34', new String[] { "JIAO", "ZHUO" }); // put('\u6821', new String[] { "JIAO", "XIAO" }); // put('\u53e5', new String[] { "JU", "GOU" }); // put('\u5361', new String[] { "KA", "QIA" }); // put('\u961a', new String[] { "KAN", "HAN" }); // put('\u7387', new String[] { "LV", "SHUAI" }); // put('\u79d8', new String[] { "MI", "BI" }); // put('\u9e1f', new String[] { "NIAO", "DIAO" }); // put('\u4e5c', new String[] { "NIE", "MIE" }); // put('\u9f50', new String[] { "QI", "JI" }); // put('\u7a3d', new String[] { "QI", "JI" }); // put('\u5f3a', new String[] { "QIANG", "JIANG" }); // put('\u90c4', new String[] { "QIE", "XI" }); // put('\u533a', new String[] { "QU", "OU" }); // put('\u5708', new String[] { "QUAN", "JUAN" }); // put('\u772d', new String[] { "SUI", "HUI" }); // put('\u5239', new String[] { "SHA", "CHA" }); // put('\u6298', new String[] { "SHE", "ZHE" }); // put('\u8398', new String[] { "SHEN", "XIN" }); // put('\u6c88', new String[] { "SHEN", "CHEN" }); // put('\u77f3', new String[] { "SHI", "DAN" }); // put('\u9561', new String[] { "TAN", "XIN" }); // put('\u9676', new String[] { "TAO", "YAO" }); // put('\u6c64', new String[] { "TANG", "SHANG" }); // put('\u4e07', new String[] { "WAN", "MO" }); // put('\u5c09', new String[] { "WEI", "YU" }); // put('\u6c76', new String[] { "WEN", "MEN" }); // put('\u9889', new String[] { "XIE", "JIE" }); // put('\u884c', new String[] { "XING", "HANG" }); // put('\u7701', new String[] { "XING", "SHENG" }); // put('\u5bbf', new String[] { "XIU", "SU" }); // put('\u53f6', new String[] { "YE", "XIE" }); // put('\u65bc', new String[] { "YU", "WU" }); // put('\u5401', new String[] { "YU", "XU" }); // put('\u8f67', new String[] { "ZHA", "YA" }); // put('\u7c98', new String[] { "ZHAN", "NIAN" }); // put('\u891a', new String[] { "ZHU", "CHU" }); // } }; /** * Check if the Chinese char has polyphony as a family name. * */ public static boolean isPolyphonyFamilyName(char c) { return mFamilyNamePolyphonyMap.containsKey(c); } }