pinyin4j 中文转拼音】的更多相关文章

一.简介 有时候,须要将汉字编程相应的拼音.以方便数据的处理.比方在Android手机应用的开发上.要查询联系人的姓名.通常都是用拼音进行查询的. 比方要查询"曹孟德",就能够输入"cmd",即"曹孟德"三个汉字的拼音"caomengde"各字的首字母.可是如何才干将"曹孟德"翻译成"caomengde"呢? 非常easy的办法就是建立一个大的对比表(比方用关联容器Map),比方<…
Java 中文转换拼音工具 /** * <html> * <body> * <P> Copyright 1994 JsonInternational</p> * <p> All rights reserved.</p> * <p> Created on 19941115</p> * <p> Created by Jason</p> * </body> * </html&…
C#中文转换为拼音NPinyin代码  在Mono 3.2下运行正常,Spacebuilder 有使用到NPinyin组件,代码兼容性没有问题. using System; using System.Collections.Generic; using System.Text; using NPinyin; namespace NPinyinTest { class Program { static void Main(string[] args) { string[] maxims = new…
用来得到中文的首字母: 这个是将中文转换为拼音的类:charset <?php/*** 汉字转化为拼音,拼音转化为汉字**/ class charset{private $_code=array(array("a",'-20319'),array("ai",'-20317'),array("an",'-20304'),array("ang",'-20295'),array("ao",'-20292')…
//php获取中文字符拼音首字母 function getFirstCharter($str){ if(empty($str)){return '';} $fchar=ord($str{}); }); $s1=iconv('UTF-8','gb2312',$str); $s2=iconv('gb2312','UTF-8',$s1); $s=$s2==$str?$s1:$str; $asc=ord($s{})*+ord($s{})-; &&$asc<=-) return 'A'; &a…
using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace SU { /// <summary> /// 中文转拼音 /// </summary> public class PinYin { #region 字符集 private static readonly string[] _charIndex = new string[] { "1&…
SQL 用中文的拼音和笔画排序   城市按拼音排序: SELECT chineseName FROM [表名] order by chinesename collate Chinese_PRC_CS_AS_KS_WS asc 城市按笔划排序: SELECT chineseName FROM [表名] order by chinesename collate Chinese_PRC_Stroke_CS_AS_KS_WS   asc 以上代码中GD上调试通过. 多说两句,排序规则名称由两部份构成,前…
Mono 3.2 测试NPinyin 中文转换拼音代码   C#中文转换为拼音NPinyin代码  在Mono 3.2下运行正常,Spacebuilder 有使用到NPinyin组件,代码兼容性没有问题. using System; using System.Collections.Generic; using System.Text; using NPinyin; namespace NPinyinTest { class Program { static void Main(string[]…
//php获取中文字符拼音首字母 function getFirstCharter($str){ if(empty($str)){ return ''; } $fchar = ord($str{0}); if($fchar >= ord('A') && $fchar <= ord('z')){ return strtoupper($str{0}); } $s1=iconv('UTF-8','gb2312',$str); $s2=iconv('gb2312','UTF-8',$s…