Imports System
Imports System
Namespace Businness
Public Class PYService
Private gDataSet As New dsPinYin
Public ReadOnly Property PinYinTable() As dsPinYin
Get
Return gDataSet
End Get
End Property
Private gTxtFile As String = AppDomain
Private gxmlFile As String = AppDomain
Private gRegex As New Regex(
Public Sub Load()
If Not IO
Throw New Exception(String
End If
DataSetInitialize()
gDataSet
End Sub
Public Sub Update()
If Not IO
Throw New Exception(String
End If
UpdateFromTxt(gTxtFile)
End Sub
Public Sub Save()
gDataSet
End Sub
Private Sub DataSetInitialize()
Me
Me
End Sub
Private Sub UpdateFromTxt(ByVal file As String)
DataSetInitialize()
Dim mLine As String
Dim mBuilder As New System
Dim mReader As New IO
Do
mLine = mReader
Add(mLine)
Loop Until String
mReader
mReader
Me
End Sub
Private Sub Add(ByVal line As String)
If line Is Nothing Then Exit Sub
With gRegex
If
If
Add(
End If
End If
End With
End Sub
Private Sub Add(ByVal word As String
py = py
Dim mCode As String = ChineseCode(word)
Dim mRow As dsPinYin
If mRow Is Nothing Then
Me
Else
Dim pyArray() As String = py
For Each s As String In pyArray
If Not mRow
mRow
End If
Next
End If
End Sub
[
From:http://tw.wingwit.com/Article/program/net/201311/15437.html