我将此方法移植到VB.NET上了,请看源码(一)

<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 728x15, 创建于 08-4-23MSDN */ google_ad_slot = "3624277373"; google_ad_width = 728; google_ad_height = 15; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 160x600, 创建于 08-4-23MSDN */ google_ad_slot = "4367022601"; google_ad_width = 160; google_ad_height = 600; //--> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
Public Class PinYin
    Private Shared a() As String = {"a", "䁢, "㡢, "玢, "㠢}
    Private Shared o() As String = {"o", "卢, "㳢, "璢, "㲢}
    Private Shared e() As String = {"e", "䓢, "㩢, "䛢, "㨢}
    Private Shared i() As String = {"i", "䫢, "㭢, "琢, "㬢}
    Private Shared u() As String = {"u", "嫢, "㺢, "產, "㹢}
    Private Shared v() As String = {"㼢, "疢, "瘢, "皢, "眢}

    '是否强制转换:如果为真,即将标明声调的数字前的韵母根据标明声调的数字转换为相应的声调
    '如果为假,即根据拼音规则转换
    Private Shared mIsCompelled As Boolean = False
    Public Shared Property IsCompelled() As Boolean
        Get
            Return mIsCompelled
        End Get
        Set(ByVal Value As Boolean)
            mIsCompelled = Value
        End Set
    End Property
    Public Shared PyList As New System.Collections.SortedList()

#Region "拼音列表集合"
    Public Shared Function LoadPyChars() As System.Collections.SortedList
        If PyList.Count > 0 Then Exit Function
        PyList.Add("a", -20319)
        PyList.Add("ai", -20317)
        PyList.Add("an", -20304)
        PyList.Add("ang", -20295)
        PyList.Add("ao", -20292)
        PyList.Add("ba", -20283)
        PyList.Add("bai", -20265)
        PyList.Add("ban", -20257)
        PyList.Add("bang", -20242)
        PyList.Add("bao", -20230)
        PyList.Add("bei", -20051)
        PyList.Add("ben", -20036)
        PyList.Add("beng", -20032)
        PyList.Add("bi", -20026)
        PyList.Add("bian", -20002)
        PyList.Add("biao", -19990)
        PyList.Add("bie", -19986)
        PyList.Add("bin", -19982)
        PyList.Add("bing", -19976)
        PyList.Add("bo", -19805)
        PyList.Add("bu", -19784)
        PyList.Add("ca", -19775)
        PyList.Add("cai", -19774)
        PyList.Add("can", -19763)
        PyList.Add("cang", -19756)
        PyList.Add("cao", -19751)
        PyList.Add("ce", -19746)
        PyList.Add("ceng", -19741)
        PyList.Add("cha", -19739)
        PyList.Add("chai", -19728)
        PyList.Add("chan", -19725)
        PyList.Add("chang", -19715)
        PyList.Add("chao", -19540)
        PyList.Add("che", -19531)
        PyList.Add("chen", -19525)
        PyList.Add("cheng", -19515)
        PyList.Add("chi", -19500)
        PyList.Add("chong", -19484)
        PyList.Add("chou", -19479)
        PyList.Add("chu", -19467)
        PyList.Add("chuai", -19289)
        PyList.Add("chuan", -19288)
        PyList.Add("chuang", -19281)
        PyList.Add("chui", -19275)
        PyList.Add("chun", -19270)
        PyList.Add("chuo", -19263)
        PyList.Add("ci", -19261)
        PyList.Add("cong", -19249)
        PyList.Add("cou", -19243)
        PyList.Add("cu", -19242)
        PyList.Add("cuan", -19238)
        PyList.Add("cui", -19235)
        PyList.Add("cun", -19227)
        PyList.Add("cuo", -19224)
        PyList.Add("da", -19218)
        PyList.Add("dai", -19212)
        PyList.Add("dan", -19038)
        PyList.Add("dang", -19023)
        PyList.Add("dao", -19018)
        PyList.Add("de", -19006)
        PyList.Add("deng", -19003)
        PyList.Add("di", -18996)
        PyList.Add("dian", -18977)
        PyList.Add("diao", -18961)
        PyList.Add("die", -18952)
        PyList.Add("ding", -18783)
        PyList.Add("diu", -18774)
        PyList.Add("dong", -18773)
        PyList.Add("dou", -18763)
        PyList.Add("du", -18756)
        PyList.Add("duan", -18741)
        PyList.Add("dui", -18735)
        PyList.Add("dun", -18731)
        PyList.Add("duo", -18722)
        PyList.Add("e", -18710)
        PyList.Add("en", -18697)
        PyList.Add("er", -18696)
        PyList.Add("fa", -18526)
        PyList.Add("fan", -18518)
        PyList.Add("fang", -18501)
        PyList.Add("fei", -18490)
        PyList.Add("fen", -18478)
        PyList.Add("feng", -18463)
        PyList.Add("fo", -18448)
        PyList.Add("fou", -18447)
        PyList.Add("fu", -18446)
        PyList.Add("ga", -18239)
        PyList.Add("gai", -18237)
        PyList.Add("gan", -18231)
        PyList.Add("gang", -18220)
        PyList.Add("gao", -18211)
        PyList.Add("ge", -18201)
        PyList.Add("gei", -18184)
        PyList.Add("gen", -18183)
        PyList.Add("geng", -18181)
        PyList.Add("gong", -18012)
        PyList.Add("gou", -17997)
        PyList.Add("gu", -17988)
        PyList.Add("gua", -17970)
        PyList.Add("guai", -17964)
        PyList.Add("guan", -17961)
        PyList.Add("guang", -17950)
        PyList.Add("gui", -17947)
        PyList.Add("gun", -17931)
        PyList.Add("guo", -17928)
        PyList.Add("ha", -17922)
        PyList.Add("hai", -17759)
        PyList.Add("han", -17752)
        PyList.Add("hang", -17733)
        PyList.Add("hao", -17730)
        PyList.Add("he", -17721)
        PyList.Add("hei", -17703)
        PyList.Add("hen", -17701)
        PyList.Add("heng", -17697)
        PyList.Add("hong", -17692)
        PyList.Add("hou", -17683)
        PyList.Add("hu", -17676)
        PyList.Add("hua", -17496)
        PyList.Add("huai", -17487)
        PyList.Add("huan", -17482)
        PyList.Add("huang", -17468)
        PyList.Add("hui", -17454)
        PyList.Add("hun", -17433)
        PyList.Add("huo", -17427)
        PyList.Add("ji", -17417)
        PyList.Add("jia", -17202)
        PyList.Add("jian", -17185)
        PyList.Add("jiang", -16983)
        PyList.Add("jiao", -16970)
        PyList.Add("jie", -16942)
        PyList.Add("jin", -16915)
        PyList.Add("jing", -16733)
        PyList.Add("jiong", -16708)
        PyList.Add("jiu", -16706)
        PyList.Add("ju", -16689)
        PyList.Add("juan", -16664)
        PyList.Add("jue", -16657)
        PyList.Add("jun", -16647)
        PyList.Add("ka", -16474)
        PyList.Add("kai", -16470)
        PyList.Add("kan", -16465)
        PyList.Add("kang", -16459)
        PyList.Add("kao", -16452)
        PyList.Add("ke", -16448)
        PyList.Add("ken", -16433)
        PyList.Add("keng", -16429)
        PyList.Add("kong", -16427)
        PyList.Add("kou", -16423)
        PyList.Add("ku", -16419)
        PyList.Add("kua", -16412)
        PyList.Add("kuai", -16407)
        PyList.Add("kuan", -16403)
        PyList.Add("kuang", -16401)
        PyList.Add("kui", -16393)
        PyList.Add("kun", -16220)
        PyList.Add("kuo", -16216)
        PyList.Add("la", -16212)
        PyList.Add("lai", -16205)
        PyList.Add("lan", -16202)
        PyList.Add("lang", -16187)
        PyList.Add("lao", -16180)
        PyList.Add("le", -16171)
        PyList.Add("lei", -16169)
        PyList.Add("leng", -16158)
        PyList.Add("li", -16155)
        PyList.Add("lia", -15959)
        PyList.Add("lian", -15958)
        PyList.Add("liang", -15944)
        PyList.Add("liao", -15933)
        PyList.Add("lie", -15920)
        PyList.Add("lin", -15915)
        PyList.Add("ling", -15903)
        PyList.Add("liu", -15889)
        PyList.Add("long", -15878)
        PyList.Add("lou", -15707)
        PyList.Add("lu", -15701)
        PyList.Add("lv", -15681)
        PyList.Add("luan", -15667)
        PyList.Add("lue", -15661)
        PyList.Add("lun", -15659)
        PyList.Add("luo", -15652)
        PyList.Add("ma", -15640)
        PyList.Add("mai", -15631)
        PyList.Add("man", -15625)
        PyList.Add("mang", -15454)
        PyList.Add("mao", -15448)
        PyList.Add("me", -15436)
        PyList.Add("mei", -15435)
        PyList.Add("men", -15419)
        PyList.Add("meng", -15416)
        PyList.Add("mi", -15408)
        PyList.Add("mian", -15394)
        PyList.Add("miao", -15385)
        PyList.Add("mie", -15377)
        PyList.Add("min", -15375)
        PyList.Add("ming", -15369)
        PyList.Add("miu", -15363)
        PyList.Add("mo", -15362)
        PyList.Add("mou", -15183)
        PyList.Add("mu", -15180)
        PyList.Add("na", -15165)
        PyList.Add("nai", -15158)
        PyList.Add("nan", -15153)
        PyList.Add("nang", -15150)
        PyList.Add("nao", -15149)
        PyList.Add("ne", -15144)
        PyList.Add("nei", -15143)
        PyList.Add("nen", -15141)
        PyList.Add("neng", -15140)
        PyList.Add("ni", -15139)
        PyList.Add("nian", -15128)
        PyList.Add("niang", -15121)
        PyList.Add("niao", -15119)
        PyList.Add("nie", -15117)
        PyList.Add("nin", -15110)
        PyList.Add("ning", -15109)
        PyList.Add("niu", -14941)
        PyList.Add("nong", -14937)
        PyList.Add("nu", -14933)
        PyList.Add("nv", -14930)
        PyList.Add("nuan", -14929)
        PyList.Add("nue", -14928)
        PyList.Add("nuo", -14926)
        PyList.Add("o", -14922)
        PyList.Add("ou", -14921)
        PyList.Add("pa", -14914)
        PyList.Add("pai", -14908)
        PyList.Add("pan", -14902)
        PyList.Add("pang", -14894)
        PyList.Add("pao", -14889)
        PyList.Add("pei", -14882)
        PyList.Add("pen", -14873)
        PyList.Add("peng", -14871)
        PyList.Add("pi", -14857)
        PyList.Add("pian", -14678)
        PyList.Add("piao", -14674)
        PyList.Add("pie", -14670)
        PyList.Add("pin", -14668)
        PyList.Add("ping", -14663)
        PyList.Add("po", -14654)
        PyList.Add("pu", -14645)
        PyList.Add("qi", -14630)
        PyList.Add("qia", -14594) 共2页: 上一页 1 [2] 下一页 <script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 728x15, 创建于 08-4-23MSDN */ google_ad_slot = "3624277373"; google_ad_width = 728; google_ad_height = 15; //--> </script> <script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
<script type="text/javascript"><!-- google_ad_client = "pub-2947489232296736"; /* 160x600, 创建于 08-4-23MSDN */ google_ad_slot = "4367022601"; google_ad_width = 160; google_ad_height = 600; //--> </script><script type="text/javascript" src="http://pagead2.googlesyndication.com/pagead/show_ads.js"> </script>
阅读更多
个人分类: .net
上一篇让Asp.NET的DataGrid可排序、可选择、可分页
下一篇中英文语音合成与中文语音识别技术在c#中的应用(二)
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭
关闭