精华内容
下载资源
问答
  • 搜狗拼音包

    2012-02-28 09:51:58
    搜狗拼音包,带有皮肤,最新的新鲜词组,最快捷的汉字输入法
  • 个人开发,其中包含中文转拼音,支持多音字和声调
  • 拼音检查jar工具

    2017-09-29 15:57:02
    android通用的拼音检查jar,可以通过加入这个jar,实现对汉子拼音的解析
  • 汉字拼音

    2019-03-18 18:22:03
    中文转拼音
  • ORACLE 获得汉字拼音包

    2009-11-24 13:46:59
    在ORACLE中,用此可以获得汉字拼音,也可以获得单独的拼音首字母,也是从网上找到的
  • 可以用来取汉字拼音的工具,自己拿去试试,这是前台使用的js工具
  • 获取完整拼音中包含拼音的个数

    千次阅读 2016-06-13 14:10:04
    用于拼音个数分类,时间空间什么的都没想 package com.shovesoft.domain.utils; import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map;...

    用于拼音个数分类,时间空间什么的都没想


    import java.util.ArrayList;
    import java.util.HashMap;
    import java.util.HashSet;
    import java.util.List;
    import java.util.Map;
    import java.util.Set;
    
    import org.apache.commons.lang.StringUtils;
    
    /**
     * @author 李鑫
     * @Date 日期 2016年6月13日
     */
    public class PYTypeUtils {
    	private static StringBuffer pyRegx = new StringBuffer();
    	private static PYTypeUtils pYTypeUtils = getInstance();
    	/**拼音集合**/
    	private Set<String> py_set;
    	/**拼音集合最大长度**/
    	private Map<String,Integer> py_map_max_length;
    	/**拼音集合最小长度**/
    	private Map<String,Integer> py_map_min_length;
    	private PYTypeUtils(){}
    	private static PYTypeUtils getInstance(){
    		if(pYTypeUtils != null)return pYTypeUtils;
    		pYTypeUtils = new PYTypeUtils();
    		String [][] values = new String [][]{
    				{"a","ai","an","ang","ao"}, 
    				{"ba","bai","ban","bang","bao","bei","ben","beng","bi","bian","biao","bie","bin","bing","bo","bu"}, 
    				{"ca","cai","can","cang","cao","ce","cen","ceng","cha","chai","chan","chang","chao","che","chen","cheng","chi","chong","chou","chu","chua","chuai","chuan","chuang","chui","chun","chuo","ci","cong","cou","cu","cuan","cui","cun","cuo"},
    				{"da","dai","dan","dang","dao","de","den","dei","deng","di","dia","dian","diao","die","ding","diu","dong","dou","du","duan","dui","dun","duo"},
    				{"e","ei","en","eng","er"}, 
    				{"fa","fan","fang","fei","fen","feng","fo","fou","fu"}, 
    				{"ga","gai","gan","gang","gao","ge","gei","gen","geng","gong","gou","gu","gua","guai","guan","guang","gui","gun","guo"}, 
    				{"ha","hai","han","hang","hao","he","hei","hen","heng","hong","hou","hu","hua","huai","huan","huang","hui","hun","huo"}, 
    				{"ji","jia","jian","jiang","jiao","jie","jin","jing","jiong","jiu","ju","juan","jue","jun","jv"},
    				{"ka","kai","kan","kang","kao","ke","ken","keng","kong","kou","ku","kua","kuai","kuan","kuang","kui","kun","kuo"}, 
    				{"la","lai","lan","lang","lao","le","lei","leng","li","lia","lian","liang","liao","lie","lin","ling","liu","long","lou","lu","luan","lue","lve","lun","luo","lv"},
    				{"ma","mai","man","mang","mao","me","mei","men","meng","mi","mian","miao","mie","min","ming","miu","mo","mou","mu"}, 
    				{"na","nai","nan","nang","nao","ne","nei","nen","neng","ni","nian","niang","niao","nie","nin","ning","niu","nong","nou","nu","nv","nuan","nue","nve","nuo","nun"},
    				{"o","ou"}, 
    				{"pa","pai","pan","pang","pao","pei","pen","peng","pi","pian","piao","pie","pin","ping","po","pou","pu"}, 
    				{"qi","qia","qian","qiang","qiao","qie","qin","qing","qiong","qiu","qu","quan","que","qun"}, 
    				{"ran","rang","rao","re","ren","reng","ri","rong","rou","ru","ruan","rui","run","ruo"}, 
    				{"sa","sai","san","sang","sao","se","sen","seng","sha","shai","shan","shang","shao","she","shei","shen","sheng","shi","shou","shu","shua","shuai","shuan","shuang","shui","shun","shuo","si","song","sou","su","suan","sui","sun","suo"},
    				{"ta","tai","tan","tang","tao","te","teng","ti","tian","tiao","tie","ting","tong","tou","tu","tuan","tui","tun","tuo"}, 
    				{"wa","wai","wan","wang","wei","wen","weng","wo","wu"}, 
    				{"xi","xia","xian","xiang","xiao","xie","xin","xing","xiong","xiu","xu","xuan","xue","xun"}, 
    				{"ya","yan","yang","yao","ye","yi","yin","ying","yo","yong","you","yu","yuan","yue","yun"}, 
    				{"za","zai","zan","zang","zao","ze","zei","zen","zeng","zha","zhai","zhan","zhang","zhao","zhe","zhei","zhen","zheng","zhi","zhong","zhou","zhu","zhua","zhuai","zhuan","zhuang","zhui","zhun","zhuo","zi","zong","zou","zu","zuan","zui","zun","zuo"}
    		};
    		pYTypeUtils.py_set = new HashSet<String>();
    		pYTypeUtils.py_map_max_length = new HashMap<String, Integer>();
    		pYTypeUtils.py_map_min_length = new HashMap<String, Integer>();
    		
    		String key = "";
    		pyRegx.setLength(0);
    		pyRegx.append("^(");
    		Integer maxlength = null,minlength = null;
    		for (int i = 0; i < values.length; i++) {
    			key = values[i][0].substring(0,1);
    			for (int j = 0; j < values[i].length; j++) {
    				pYTypeUtils.py_set.add(values[i][j]);
    				if((i > 0 || j > 0) && !(i == values.length - 1 && j == values[i].length)){
    					pyRegx.append("|");
    				}
    				pyRegx.append(values[i][j]);
    				maxlength = pYTypeUtils.py_map_max_length.get(key);
    				if(maxlength == null || maxlength < values[i][j].length()){
    					pYTypeUtils.py_map_max_length.put(key, values[i][j].length());
    					
    				}
    
    				minlength = pYTypeUtils.py_map_min_length.get(key);
    				if(maxlength == null || minlength > values[i][j].length()){
    					pYTypeUtils.py_map_min_length.put(key, values[i][j].length());
    				}
    			}
    			
    		}
    		pyRegx.append(")+$");
    		return pYTypeUtils;
    	}
    	
    	/**
    	 * 找拼音
    	 * @param value
    	 * @param clength 偏差长度,例如lingua 可以分为 lin gua 、lin gu a
    	 * @return null 不是拼音,找打的拼音
    	 */
    	private String findFirstPY(String value,int clength){
    		value = value.toLowerCase();
    		String head = value.charAt(0)+"";
    		Integer maxLength = py_map_max_length.get(head);
    		Integer minLength = py_map_min_length.get(head);
    		if(maxLength == null || minLength == null || value.length() < minLength){//字符判断
    			return null;
    		}
    		else if(py_set.contains(value)){
    			return value;
    		}
    		if(value.length() < maxLength){
    			maxLength = value.length();
    		}
    		
    		maxLength -= clength;
    		
    		if(maxLength < minLength){
    			maxLength = minLength;
    		}
    		
    		for (int i = maxLength; i >= minLength; i--) {
    			String v = value.substring(0, i);
    			if(py_set.contains(v)){
    				return v;
    			}
    		}
    		return null;
    	}
    	/**
    	 * 计算拼音数量
    	 * @param value
    	 * @param g
    	 * @return
    	 */
    	private int checkAllGroupPYCount(String value,int [] g){
    		value = value.toLowerCase();
    		String head = value.charAt(0)+"";
    		Integer maxLength = py_map_max_length.get(head);
    		Integer minLength = py_map_min_length.get(head);
    		if(maxLength == null || minLength == null || value.length() < minLength){
    			g[0]--;
    			return g[0];
    		}
    		
    		Integer clengthCount = maxLength - minLength + 1;
    		for (int i = 0; i < clengthCount; i++) {
    			String v = findFirstPY(value,i);
    			if(StringUtils.isNotBlank(v)){
    				g[0]++;
    			}else{
    				continue;
    			}
    			
    			String nv = value.substring(v.length());
    			if(nv == null || nv.length() == 0)
    			{
    				g[1]=-1;//终止查找标记
    				return g[0];
    			}
    			checkAllGroupPYCount(nv,g);
    			if(g[1] != 0){
    				return g[0];
    			}
    		}
    		
    		return g[0];
    	}
    	
    	/**
    	 * 检查是否完整的拼音
    	 * @param value
    	 * @return
    	 */
    	public static boolean checkAllIsPY(String value){
    		return value.matches(pyRegx.toString());
    	}
    	
    	/**
    	 * 检查是否完整的拼音并且获取拼音个数
    	 * @param value
    	 * @return
    	 */
    	public static int checkAllGroupPYCount(String value){
    		if(!checkAllIsPY(value)){
    			return 0;
    		}
    		return pYTypeUtils.checkAllGroupPYCount(value,new int[2]);
    	}
    	
    	public static void main(String[] args) {
    		System.out.println(pYTypeUtils.checkAllGroupPYCount("sasasasasa"));
    	}
    }
    




    展开全文
  • js中处理汉字转拼音的基础js文件。可以获取汉字对应的拼音,首字母等。只有几个简单的方法。留着备用。
  • android 汉字转拼音包

    2012-11-29 14:57:55
    这是一个android的汉字转拼音包,用于数据查询搜索的。
  • oracle 中文转拼音工具
  • 汉字转化为拼音的jar,包含源码及Demo样例,轻松实现汉字转化为汉语拼音
  • 汉字转拼音jar

    2014-11-06 15:08:29
    汉字转拼音jar,使用android和java,还有繁体转换等功能
  • 中文汉字转拼音,java写的,资源里面有介绍。
  • ibus拼音输入法RPM

    热门讨论 2010-09-16 00:02:47
    号称linux下的搜狗拼音输入法,ibus-SunPinYin-2.0.1-0.i686.rpm 比SCIM好太多了
  • 汉字转换成拼音jar

    2011-12-29 17:00:07
    汉字转换成拼音的一个jar,可以令你方便的使用,以上的代码,仅是参考
  • 通过改jar,可以完成汉字,中文通过java后台操作转换为拼音全拼或者简拼
  • Java中文转拼音jar

    2014-01-10 11:22:00
    使用于java开发中的中文和拼音转换,占用空间少,希望能对你有所帮助! 使用于java开发中的中文和拼音转换,占用空间少,希望能对你有所帮助!
  • ik分词修改后适用于solr6.4.2验证通过,拼音分词支持全拼简拼与误拼
  • 汉字转拼音 包含了所需jar和示例源码 有需要的朋友可以下载
  • java实现将汉字转为拼音并包含音调

    万次阅读 2019-04-09 14:13:14
    有时候为了方便操作程序的开发,需要将汉字转为拼音等操作。下面这个是自己结合网上的资料,加上自己在公司项目中的亲自实践。完整的实现了将汉字转为拼音的操作。这个Demo只是负责将其转换,在main方法中测试,在...

           有时候为了方便操作程序的开发,需要将汉字转为拼音等操作。下面这个是自己结合网上的资料,加上自己在公司项目中的亲自实践。完整的实现了将汉字转为拼音的操作。这个Demo只是负责将其转换,在main方法中测试,在实际需要中,只需要调用这个类中的方法即可。

       首先贴出测试结果:

          

       测试参数:

            汉字转换为拼音

            汉字转换为拼音

         main测试方法的代码:

    public static void main(String[] args) {
        System.out.println(ToFirstChar("汉字转换为拼音").toUpperCase()); //转为首字母大写
        System.out.println(ToPinyin("汉字转换为拼音")); 
    }

           本功能的实现时利用java开源库,开发此程序需要一个jar包。本人用的是pinyin.jar。网上可以直接下载,也可以在其官网进行下载。在此不祥述。如果实在不乐意,可以点击下载将进行这个jar包的下载。

      贴出实现该Demo的源码:

    package com.red.test;
    
    import net.sourceforge.pinyin4j.PinyinHelper;
    import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType;
    import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat;
    import net.sourceforge.pinyin4j.format.HanyuPinyinToneType;
    import net.sourceforge.pinyin4j.format.exception.BadHanyuPinyinOutputFormatCombination;
    
    /**
     * 汉字转换为拼音
     * @author Red
     */
    public class PinyinDemo {
        /**
         * 测试main方法
         * @param args
         */
        public static void main(String[] args) {
            System.out.println(ToFirstChar("汉字转换为拼音").toUpperCase()); //转为首字母大写
            System.out.println(ToPinyin("汉字转换为拼音")); 
        }
        /**
         * 获取字符串拼音的第一个字母
         * @param chinese
         * @return
         */
        public static String ToFirstChar(String chinese){         
            String pinyinStr = "";  
            char[] newChar = chinese.toCharArray();  //转为单个字符
            HanyuPinyinOutputFormat defaultFormat = new HanyuPinyinOutputFormat(); 
            defaultFormat.setCaseType(HanyuPinyinCaseType.LOWERCASE);  
            defaultFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE);  
            for (int i = 0; i < newChar.length; i++) {  
                if (newChar[i] > 128) {  
                    try {  
                        pinyinStr += PinyinHelper.toHanyuPinyinStringArray(newChar[i], defaultFormat)[0].charAt(0);  
                    } catch (BadHanyuPinyinOutputFormatCombination e) {  
                        e.printStackTrace();  
                    }  
                }else{  
                    pinyinStr += newChar[i];  
                }  
            }  
            return pinyinStr;  
        }  
       
        /**
         * 汉字转为拼音
         * @param chinese
         * @return
         */
        public static String ToPinyin(String chinese){          
            String pinyinStr = "";  
            char[] newChar = chinese.toCharArray();  
            HanyuPinyinOutputFormat defaultFormat = new HanyuPinyinOutputFormat();  
            defaultFormat.setCaseType(HanyuPinyinCaseType.LOWERCASE);  
            defaultFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE);  
            for (int i = 0; i < newChar.length; i++) {  
                if (newChar[i] > 128) {  
                    try {  
                        pinyinStr += PinyinHelper.toHanyuPinyinStringArray(newChar[i], defaultFormat)[0];  
                    } catch (BadHanyuPinyinOutputFormatCombination e) {  
                        e.printStackTrace();  
                    }  
                }else{  
                    pinyinStr += newChar[i];  
                }  
            }  
            return pinyinStr;  
        }  
    }

    补充:查询拼音全拼并包含音调

    	public static String getPinYin(String src) {
    		char[] t1 = null;
    		t1 = src.toCharArray();
    		String[] t2 = new String[t1.length];
    		//t3是全部的拼音,不带声调
    		HanyuPinyinOutputFormat t3 = new HanyuPinyinOutputFormat();
    		t3.setCaseType(HanyuPinyinCaseType.LOWERCASE);
    		t3.setToneType(HanyuPinyinToneType.WITHOUT_TONE);
    		t3.setVCharType(HanyuPinyinVCharType.WITH_V);
    		
    		//format是全部的拼音并且带声调
    		HanyuPinyinOutputFormat format= new HanyuPinyinOutputFormat();
    		format.setToneType(HanyuPinyinToneType.WITH_TONE_MARK);
    		format.setVCharType(HanyuPinyinVCharType.WITH_U_UNICODE);
    		
    		
    		
    		String t4 = "";
    		int t0 = t1.length;
    		try {
    			for (int i = 0; i < t0; i++) {
    				// 判断是否为汉字字符
    				if (java.lang.Character.toString(t1[i]).matches(
    						"[\\u4E00-\\u9FA5]+")) {
    //					t2 = PinyinHelper.toHanyuPinyinStringArray(t1[i], t3);
    					t2 = PinyinHelper.toHanyuPinyinStringArray(t1[i], format);
    					t4 += t2[0]+" ";
    				} else {
    					t4 += java.lang.Character.toString(t1[i]);
    				}
    			}
    			return t4;
    		} catch (BadHanyuPinyinOutputFormatCombination e1) {
    			e1.printStackTrace();
    		}
    		return t4;
    	}
    

     

    展开全文
  • 中文转拼音非maven版含jar
  • 需求:页面查询框输入汉字首字母或全拼查询需求,这里主要实现为,在数据库增加一个字段存放拼音,然后新增的时候将中文转拼音后存入该字段。后续方便查询   // 将汉字转化为全拼 public static String ...

        需求:页面查询框输入汉字首字母或全拼查询需求,这里主要实现为,在数据库增加一个字段存放拼音,然后新增的时候将中文转拼音后存入该字段。后续方便查询

     

    // 将汉字转化为全拼
    	public static String getPinyin(String src)
    	{
    		char toChar[] = src.toCharArray();
    		String[] toCharCp = new String[toChar.length];
    		HanyuPinyinOutputFormat hanyuFormat = new HanyuPinyinOutputFormat();
    		hanyuFormat.setCaseType(HanyuPinyinCaseType.LOWERCASE);
    		hanyuFormat.setToneType(HanyuPinyinToneType.WITHOUT_TONE);
    		hanyuFormat.setVCharType(HanyuPinyinVCharType.WITH_V);
    		StringBuilder sb = new StringBuilder();
    		try
    		{
    			for (int i = 0; i < toChar.length; i++)
    			{
    				// 判断是否为汉字字符
    				if (Character.toString(toChar[i]).matches("[\\u4E00-\\u9FA5]+"))
    				{
    					toCharCp = PinyinHelper.toHanyuPinyinStringArray(toChar[i], hanyuFormat);
    					sb.append(toCharCp[0]);
    				}
    				else
    				{
    					sb.append(Character.toString(toChar[i]));
    				}
    			}
    		}
    		catch (BadHanyuPinyinOutputFormatCombination e)
    		{
    			e.printStackTrace();
    		}
    		return sb.toString();
    
    	}
    
    	// ----------------------------------------返回中文的首字母--------------------
    	public static String getPinYinHeadChar(String str)
    	{
    		String convert = "";
    		for (int i = 0; i < str.length(); i++)
    		{
    			char word = str.charAt(i);
    			String[] pinYinArray = PinyinHelper.toHanyuPinyinStringArray(word);
    			if (pinYinArray != null)
    			{
    				convert += pinYinArray[0].charAt(0);
    
    			}
    			else
    			{
    				convert += word;
    			}
    		}
    		return convert;
    	}
    
    	// -------------------------将字符串转換为ASCII码-----------------------------
    	public static String getCnASCII(String cnStr)
    	{
    		StringBuffer strBuf = new StringBuffer();
    		byte[] bGBK = cnStr.getBytes();
    
    		for (int i = 0; i < bGBK.length; i++)
    		{
    			strBuf.append(Integer.toHexString(bGBK[i] & 0xff));
    		}
    		return strBuf.toString();
    
    	}
    
    	// --------------------------测试拼音转汉字是否正确----------------------------
    	public static void main(String[] args)
    	{
    		System.out.println(getPinyin("联创集团abc1"));
    		// 返回拼音的全拼样式
    		System.out.println(getPinYinHeadChar("中运天狂11"));
    		// 返回拼音的首字母
    		System.out.println(getCnASCII("联创集团"));
    		// 返回拼音的ASCII
    		System.out.println();
    	}

     

    展开全文
  • 编 写 汉 字 转 为 拼 音 工 具 类 所 必 需 的 jar
  • 可以将中文汉字转换为汉语拼音,效率很高,使用方便
  • java的中文拼音搜索jar maven下的目录E:\maven_repository\repository\net\sourceforge\pinyin4j\pinyin4j-core\2.5.0
  • 可以实现汉字转拼音功能,里面有第三方java,直接加到工程的lib可以使用,配置工程后即可运行,若有疑问可以留言
  • 触摸屏T9拼音输入法开发..rar
  • lucene6.6中适配的拼音分词jar以及ik中文分词jar,以及自定义的分词词组和停词,可以实现lucene建立索引时进行拼音和中文的分词。
  • 汉字转拼音的JAVA代码示例,可以根据要求将汉字转换为相应的拼音拼音首字母等,基于流行的pinyin4j库,使用简单方便

空空如也

空空如也

1 2 3 4 5 ... 20
收藏数 47,180
精华内容 18,872
关键字:

包图拼音