--获取全拼 DECLARE @str VARCHAR(max) SET @str= [dbo].[fn_Getquanpin]('中山') PRINT(@str) )) ) as begin ),) declare @strlen int select @strlen=len(@str),@re='' begin ) select @re= case when @crs<'吖' then @crs when @crs<='厑' then 'a' when @crs<='靉' then…
/** * 汉字转换为拼音 包含多音字,包含生母zh,ch,sh的 */ public void toPinYinAll(){ String initials = "zh,ch,sh"; //返回汉语拼音的全拼 List<String> result = new ArrayList<String>(); //返回汉语拼音的单拼 List<String> firstResult = new ArrayList<String>(); resu…
SQL汉字转拼音函数-支持首字母.全拼 FROM :http://my.oschina.net/ind/blog/191659 作者不详 --方法一sqlserver汉字转拼音首字母 --调用方法 select dbo.procGetPY ('中國') Create FUNCTION dbo.procGetPY ( ) ) /* select dbo. procGetPYFirstLetter ('中國') */ ) --WITH ENCRYPTION AS BEGIN ),) SET @PY=…
使用类库为 https://gitee.com/kuiyu/dotnetcodes/tree/master/DotNet.Utilities/%E6%B1%89%E5%AD%97%E8%BD%AC%E6%8B%BC%E9%9F%B3 取首字母 textBox2.Text = PinYin.GetCodstring(textBox1.Text); 取汉字全拼 EcanConvertToCh toCh = new EcanConvertToCh(); textBox3.Text = toCh.con…
开发中用到的方法,取出第一个汉字的首字母: /** * 取汉字的第一个字的首字母 * @param string $str * @return string|null */ function getFirstChar($str) { if (empty($str)) { return ''; } $fir = $fchar = ord($str[0]); if ($fchar >= ord('A') && $fchar <= ord('z')) { return strtoup…
package oa.common.utils;   import net.sourceforge.pinyin4j.PinyinHelper; import net.sourceforge.pinyin4j.format.HanyuPinyinCaseType; import net.sourceforge.pinyin4j.format.HanyuPinyinOutputFormat; import net.sourceforge.pinyin4j.format.HanyuPinyinTon…
需求:             有时我们为了节省用户的维护量,需要根据中文生成出相应的拼音和缩写 解决:            此方法是利用汉字和Unicode编码对应找到相应字母 一.编写汉字和编码文件对应的js:  pyconst.js export const pinyin = { 'a': '\u554a\u963f\u9515', 'ai': '\u57c3\u6328\u54ce\u5509\u54c0\u7691\u764c\u853c\u77ee\u827e\u788d\u723…
<?php /** * 取汉字拼音 * edit by www.jbxue.com */ class GetPingYing { private $pylist = array( 'a'=>-20319, 'ai'=>-20317, 'an'=>-20304, 'ang'=>-20295, 'ao'=>-20292, 'ba'=>-20283, 'bai'=>-20265, 'ban'=>-20257, 'bang'=>-20242, 'bao'…
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.p…
一.先摆需求: 1.中文搜索.英文搜索.中英混搜   如:"南京东路","cafe 南京东路店" 2.全拼搜索.首字母搜索.中文+全拼.中文+首字母混搜   如:"nanjingdonglu","njdl","南京donglu","南京dl","nang南东路","njd路"等等组合 3.简繁搜索.特殊符号过滤搜索   如:"龍馬&quo…