vb.net中文分词 vbnet字典类型( 二 )


else if(tmp=49324tmp=49895){getpychar= "L";}
else if(tmp=49896tmp=50370){getpychar= "M";}
else if(tmp=50371tmp=50613){getpychar= "N";}
else if(tmp=50614tmp=50621){getpychar= "O";}
else if(tmp=50622tmp=50905){getpychar= "P";}
else if(tmp=50906tmp=51386){getpychar= "Q";}
else if(tmp=51387tmp=51445){getpychar= "R";}
else if(tmp=51446tmp=52217){getpychar= "S";}
else if(tmp=52218tmp=52697){getpychar= "T";}
else if(tmp=52698tmp=52979){getpychar= "W";}
else if(tmp=52980tmp=53640){getpychar= "X";}
else if(tmp=53689tmp=54480){getpychar= "Y";}
else if(tmp=54481tmp=55289){getpychar= "Z";}
return getpychar;
}
else
{
return hz;
}
}
public string transpy(string strhz)//把汉字字符串转换成拼音码
{
string strtemp="";
int strlen=strhz.Length;
for (int i=0;i=strlen-1;i++)
{
strtemp+=hz2py(strhz.Substring(i,1));
}
return strtemp;
}
create table tabpy(id int identity,b_begin varbinary(2),b_end varbinary(2),word varchar(2))
insert tabpy select 0xB0A1, 0xB0C4,'A'
union all select 0xB0C5, 0xB2C0,'B'
union all select 0xB2C1, 0xB4ED,'C'
union all select 0xB4EE, 0xB6E9,'D'
union all select 0xB6EA, 0xB7A1,'E'
union all select 0xB7A2, 0xB8C0,'F'
union all select 0xB8C1, 0xB9FD,'G'
union all select 0xB9FE, 0xBBF6,'H'
union all select 0xBBF7, 0xBFA5,'J'
union all select 0xBFA6, 0xC0AB,'K'
union all select 0xC0AC, 0xC2E7,'L'
union all select 0xC2E8, 0xC4C2,'M'
union all select 0xC4C3, 0xC5B5,'N'
union all select 0xC5B6, 0xC5BD,'O'
union all select 0xC5BE, 0xC6D9,'P'
union all select 0xC6DA, 0xC8BA,'Q'
union all select 0xC8BB, 0xC8F5,'R'
union all select 0xC8F6, 0xCBF9,'S'
union all select 0xCBFA, 0xCDD9,'T'
union all select 0xCDDA, 0xCEF3,'W'
union all select 0xCEF4, 0xD1B8,'X'
union all select 0xD1B9, 0xD4D0,'Y'
union all select 0xD4D1, 0xD7F9,'Z'
函数:
create function getfirstpy(@a varchar(200))
returns varchar(100)
as
begin
declare @i int,@j int,@result varchar(100)
set @result=''
set @i=len(@a)
set @j=1
while @j=@i
begin
select @result=@result+word from tabpy where cast(substring(@a,@j,1) as varbinary(2)) between b_begin and b_end
set @j=@j+1
end
return @result
end
vb.net 中 \uxxxx这类的编码实现转换成中文Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim S1 As String
Dim S2 As String
Dim S3 As String
Dim I1 As String
S1 = "\u652f\u4ed8\u5b9d"
S1 = Trim(S1)
Do While Len(S1)1
I1 = InStr(1, S1, "\u")
If I10 Then
S3 = S3Strings.Left(S1, I1 - 1)
S2 = "H"Mid(S1, I1 + 2, 4)
S2 = ChrW(S2)
S3 = S3S2
S1 = Strings.Right(S1, Len(S1) - I1 - 5)
Else
S3 = S3S1
S1 = ""
End If
Loop
MsgBox(S3)
End Sub
vb和vb.net是一样的吗?有什么不同?1、从OOP概念上讲vb.net中文分词,VB不是一个真正的面对对象的语言,他不支持继承等一些面对对象的特性 , 而VB.net是一个面对对象的语言 , 支持这些特性
2、VB和VB.net都可以用来网络编程的,这点可以肯定 , 两者都有这个功能
VB是通过控件进行网络编程,而VB.net可以通过VB的控件,也可以是用.net框架提供的system.net命名空间下的所有的类
3、正确理解VB.net中的.net , .NET 是微软推出的一种新的编程思想和模式,对于网络提出了一个新的概念(当然功能有了很大的革新),微软在.net 框架中规定了通用语言规范,只要符合这个规范 , 都可以利用.net强大的功能来完成任务,比如delphi.net ,他是.net和通用语言规范结合的产物,.net 框架提供了好多功能,简单列出一些命名空间

推荐阅读