Use Microsoft Visual Studio International pack 1.0 to convert simplified and traditional Chinese characters and obtain Chinese characters, Pinyin, and strokes.

Source: Internet
Author: User

Microsoft Visual Studio international feature package 2.0
: Http://www.microsoft.com/downloads/details.aspx? Familyid = 7d1df9ce-4aee-467f-996e-bec826c5daa2 & displaylang = ZH-CN

Microsoft Visual Studio international feature package 2.0
Visual Studio International Feature Pack 2.0 contains a group of controls and class libraries designed to help. NET developers create InternationalizationProgram.
Visual Studio International Feature Pack 2.0 is an extension of version 1.0 (Product Name of version 1.0 is Microsoft Visual Studio International pack 1.0 SR1). It contains a group of controls and class libraries designed for help. NET developers create international programs.
 


after downloading, decompress the package. There are seven MSI files, including chspinyinconv. MSI is related to Chinese characters and pinyin, and chtchsconv. MSI is a conversion between simplified and Traditional Chinese. Install the two MSI values. After the installation is complete, you need to add references in vs to reference: C: \ Program Files \ Microsoft Visual Studio International pack \ Simplified Chinese pin-yin conversion library and C: \ Program Files \ Microsoft Visual Studio International pack \ traditional Chinese to simplified Chinese conversion library and add-in tool dll can be used. The following is an example of a Chinese character "Meng":

C # Code
using system;
using system. collections. generic;
using system. web;
using system. web. ui;
using system. web. UI. webcontrols;
using Microsoft. international. converters. pinyinconverter;
using Microsoft. international. converters. traditionalchinesetosimplifiedconverter;
using system. collections. objectmodel;


Public partial class default2: system. Web. UI. Page
{

Protected void page_load (Object sender, eventargs E)
{
Chinesechar = new chinesechar ('meng ');
Response. Write ("<H2> information about Chinese characters" Meng ": </H2> ");
Response. Write ("<li>" Meng "pen number:" + chinesechar. getstrokenumber ('meng '));
Response. Write ("<li>" Meng "is a Polyphonic word:" + chinesechar. ispolyphone );
Readonlycollection <string> pinyin = chinesechar. pinyins;
Response. Write ("<li>" Meng "All pinyin :");
Foreach (string pin in pinyin)
{
Response. Write (PIN + ",");
}

Char [] chinesechars;

Response. Write ("<li> Chinese characters of all pinyin meng1 <br/> ");
Chinesechars = chinesechar. getchars ("meng1 ");
Response. Write ("Total" + chinesechars. length. tostring () + ", respectively :");
For (INT I = 0; I <chinesechars. length; I ++)
{
Response. Write (chinesechars [I] + ",");
}

Response. Write ("<li> Chinese characters of all pinyin meng2 <br/> ");

Chinesechars = chinesechar. getchars ("meng2 ");
Response. Write ("Total" + chinesechars. length. tostring () + ", respectively :");
For (INT I = 0; I <chinesechars. length; I ++)
{
Response. Write (chinesechars [I]);
}

Response. Write ("<li> Chinese characters of all pinyin meng3 <br/> ");
Chinesechars = chinesechar. getchars ("meng3 ");
Response. Write ("Total" + chinesechars. length. tostring () + ", respectively :");
For (INT I = 0; I <chinesechars. length; I ++)
{
Response. Write (chinesechars [I]);
}
Response. Write ("<li> Chinese characters of all pinyin meng2 <br/> ");
Chinesechars = chinesechar. getchars ("meng4 ");
Response. Write ("Total" + chinesechars. length. tostring () + ", respectively :");
For (INT I = 0; I <chinesechars. length; I ++)
{
Response. Write (chinesechars [I]);
}
Response. Write ("<li> Chinese characters of all pinyin meng5 <br/> ");
Chinesechars = chinesechar. getchars ("meng5 ");
Response. Write ("Total" + chinesechars. length. tostring () + ", respectively :");
For (INT I = 0; I <chinesechars. length; I ++)
{
Response. Write (chinesechars [I]);
}

String simtext = "Welcome to Chapter E of Mencius ]";
String tratext = chineseconverter. Convert (simtext, chineseconversiondirection. simplifiedtotraditional );
Response. Write ("<li> simplified conversion test:" + tratext );
}
}

The result is:

Information about Chinese characters "Meng:
Number of "Meng" strokes: 8
Whether "Meng" is a Polyphonic word: True
All Pinyin of "Meng": meng4, meng5 ,,,,,,,
All Chinese characters of Pinyin meng1
There are 4 in total, which are: upper, lower, lower, and lower,
All Chinese characters of Pinyin meng2
A total of 45, respectively: there are two major challenges: too many other users
All Chinese characters of Pinyin meng3
A total of 16, respectively: zookeeper, Zookeeper, and zookeeper.
All Chinese characters of Pinyin meng2
There are 6 in total: Meng mengmeng
All Chinese characters of Pinyin meng5
A total of 61, respectively: there are two major challenges: there was a problem in the early stage of the study.
Simplified conversion test: Welcome to Chapter E of Mencius]
Note:

I don't know which Chinese Character Standard the tool references, and I haven't seen any instructions on the SDK. The word "Meng" is not a Polyphonic word in the dictionary;
The 1, 2, 3, 4, and 5 behind the pinyin alphabet should be tone marks: Yin Ping, yang ping, upper voice, voice, and soft voice. Whether it is to be verified;
The conversion between Simplified Chinese and Traditional Chinese is relatively simple. The following code converts Simplified Chinese to traditional Chinese:

C # code
String simtext = "Welcome to Chapter E of Mencius ]";
String tratext = chineseconverter. Convert (simtext, chineseconversiondirection. simplifiedtotraditional );
Response. Write ("<li> simplified conversion test:" + tratext );
The following is a member of the Microsoft. International. converters. pinyinconverter. chinesechar class:

It encapsulates basic information such as pronunciation and strokes of Simplified Chinese.

Member description
The constructor of the chinesecharnew (char) chinesechar class.
Chinesecharacter obtains the Chinese character.
Comparestrokenumber (char) compares the given characters with the number of strokes of the Instance characters.
The static member getcharcount (int16) retrieves the number of characters with the specified number of strokes.
The static member getchars (string) obtains all homophone characters of a given pinyin.
The static member getchars (int16) Retrieves all strings with the specified number of strokes.
The static member gethomophonecount (string) retrieves the number of characters with the specified pinyin alphabet.
The static member getstrokenumber (char) retrieves the number of strokes of a specified character.
Hassound (string) identifies whether a character has a specified pronunciation.
Ishomophone (char) identifies whether the given character is the homophone of the Instance character.
The static member ishomophone (char, char) identifies whether the two characters are homophone characters.
Ispolyphone checks whether the character is a Polyphonic word.
The static member isvalidchar (char) identifies whether the given string is a valid Chinese character.
The static member isvalidpinyin (string) identifies whether the given Pinyin is a valid pinyin string.
The static member isvalidstrokenumber (int16) identifies whether the number of strokes is a valid number.
Pinyincount gets the number of Pinyin characters for this character.
Pinyins gets the Pinyin of this character.
The strokenumber is used to obtain the number of strokes for this character.



for other information, please participate in the CHM help file for random installation.

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.