Install Google Pinyin input method in Ubuntu and solve the problem that the input method cannot print Chinese characters. install Google Pinyin input method in Ubuntu (which is actually an extension of scim) as follows: www.2cto. comA. get the code: (install git first without git: sudoapt-getinstall... install Google
When you input Chinese characters in php, you need to automatically extract Chinese characters and English letters to facilitate data indexing.
Only the code is pasted here. the online api is used in English and the class library is used in Chinese. I think this
$pinyins = Array ();When the phonetic ishead=0 of a string of Chinese characters is obtained, the output pinyin first letter when outputting the whole phonetic ishead=1function Getpinyin ($str, $ishead =0, $isclose =1) {Global $pinyins;$restr = "";$str = Trim ($STR);$slen = strlen ($STR);if ($slen if (count ($pinyins) ==0) {$fp = fopen ("./pinyin.db", "R");while
' Zao ', N ' ovens 'UNION ALL select ' Ze ', N ' 稄 'UNION ALL SELECT ' Zei ', N ' 鱡 'UNION ALL SELECT ' Zen ', N ' 囎 'UNION ALL select ' Zeng ', N ' giveaway 'UNION ALL SELECT ' Zha ', N ' winepress 'UNION ALL SELECT ' Zhai ', N ' partners 'UNION ALL SELECT ' Zhan ', N ' 驏 'UNION ALL select ' Zhang ', N ' 瞕 'UNION ALL select ' Zhao ', N ' 羄 'UNION ALL SELECT ' Zhe ', N ' 鷓 'UNION ALL select ' Zhen ', N ' gloom 'UNION ALL select ' Zheng ', N ' certificate 'UNION ALL select ' Zhi ', N ' 豒 'UNION
. h file#import @interface chinesetool: nsobject /*** kanji to pinyin** @param Chinese the kanji to be converted* @param stripdiacritics need phonetic transcription** @return Pinyin*/+ (nsstring *) Pinyinforchinese: (nsstring *) Chinese stripdiacritics: (BOOL) stripdiacritics; /*** sort the array of
Label:according to the phonetic sorting of Chinese characters, the comparison is more in the sort of the name, according to the phonetic Alphabet of the surname, from A to Z sort;1. If the field that stores the name uses the GBK character set, it is good to do, because the GBK code encoding itself using the method of phonetic sorting (commonly used first-class Chinese
This article mainly introduces the example of converting Chinese characters into pinyin in php. For more information, see
The code is as follows:
Class Helper_Spell {
Public $ spellArray = array ();
Static public function getArray (){
Return unserialize(file_get_contents('pytable_without_tune.txt '));
}
/**
* @ Desc get the first letter of the string
* @ Param
Php converts Chinese characters to pinyin
Function Pinyin ($ _ String, $ _ Code = 'gb2312 ')
{
$ _ DataKey = "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 | ceng | cha ".
Recently to develop the conversion of Chinese characters to pinyin and to get the function of the first word record down Hazi: hehe ~
Class pinyin{Private $_outencoding = "GB2312"; Public Function Getpinyin ($str, $pix = ', $code = ' gb2312 ') {$_datakey = ' a|ai|an|ang|ao|ba|bai|ban|bang|bao|bei|ben| Beng|bi|bian|bi
)! = ",") {str+=pydic.charat (Pydic.indexof (Cc.charat (i)) +s); S++; } STR+=" "; } Else{str+=Cc.charat (i); } } returnstr; }In the middle need to use a JS file, can be directly online view: Http://www.wxp123.me/Public/js/pinyin/pinyin.js--------------------------------------------------------------------------------------------------------------- -----------Do not love to talk,
Php is used to obtain the first letter of Chinese characters and pinyin. The code for php to copy the first letter of Chinese character Pinyin is as follows :? Phpfunctiongetinitial ($ str) {$ ascord (substr ($ str, 0, 1); if ($ asc160) non-
$ asc If ($ asc >=- 13318 and $ asc If ($ asc >=- 12838 and $ asc If ($ asc >=- 12556 and $ asc If ($ asc >=- 11847 and $ asc If ($ asc >=- 11055 and $ asc Return null;} The above function returns the first letter of a single Chinese character.To process a Chinese string, you only need to write a new function to obtain the first letter of a string of
You can use pinyin4j. jar to convert Chinese characters to pinyin. The Code is as follows:
Package mainapp; You can search for "pinyin4j. Jar" from the "resource channel" of csdn to find related resources and introduce them to the project.Pinyin4j can obtain pinyin corresponding to
Copy Code code as follows:
Convert Chinese characters to Pinyin (full spelling)
public static string Converte (String hzstring)
{
Match Chinese characters
Regex regex = new Regex ("^[\u4e00-\u9fa5]$");
byte[] array = new BYTE[2];
String pystring = "";
int CHRASC
JSPinyin is better than the library of pinyin. js, and it is more accurate to translate Chinese into pinyin.
JSPinyin provides two methods:
1) One is to translate Chinese characters into pinyin, where the first letter of each wo
This article mainly introduces the function code for converting Chinese characters into pinyin in PHP. php converts Chinese characters into pinyin, interested friends can refer to the example in this article to share with you the
: This article mainly introduces the function code for converting Chinese characters into pinyin in PHP. For more information about PHP tutorials, see. This article provides an example of the function code for converting Chinese characters into
This article mainly introduces the function code for converting Chinese characters into pinyin in PHP. php converts Chinese characters into pinyin, interested friends can refer to the example in this article to share with you the
We know that Silverlight does not support GB2312 encoding. Therefore, Silverlight for Windows Phone naturally does not support GB2312 encoding, and thus cannot use the "C # Chinese character to PinYin" method on the Internet. In fact, we can use a stupid method to put Chinese characters and
Special effects for converting Chinese characters to PinYin Based on jQuery. Hz2Py. js plug-in and jquery special effects plug-in
You can implement conversion of Chinese characters into pinyin code based on jQuery. This is a speci
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.