请问如何比较中文字符相似

ykb 2003-04-16 07:29:25
比如:
电子工业出版社与北京电子工业出版社 是相似 与清华出版社是不相似的

两个字符串中有4个以上相同的字 是相似的

这个该如何实现?
...全文
94 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
ekun008 2003-04-20
  • 打赏
  • 举报
回复
www.solarstones.com/wzq
shanxing 2003-04-19
  • 打赏
  • 举报
回复
俺是来学习的`~~
yoki 2003-04-19
  • 打赏
  • 举报
回复
个字符串中有4个以上相同的字 是相似的 ??
应该是连续4个字符相同吧?
Chiff 2003-04-19
  • 打赏
  • 举报
回复
select 1 as id,'电子工业出版社' as name into #t
union all
select 2,'北京电子工业出版社'
union all
select 3,'清华出版社'
union all
select 4,'清华出版社分社'


select id,name into #t1 from #t where 1=2

declare @n int
set @n = 1

while @n < (select max(len(name)) from #t) - 3
begin
insert into #t1 select id,substring(name,@n,4) from #t where len(name) > @n + 2
set @n = @n + 1
end


select a.name,b.name as '与之近似' from #t a,#t b,
(select distinct a.id as aid,b.id as bid
from #t1 a,#t1 b where a.id < b.id and a.name = b.name) as c
where a.id = c.aid and b.id = c.bid

34,593

社区成员

发帖
与我相关
我的任务
社区描述
MS-SQL Server相关内容讨论专区
社区管理员
  • 基础类社区
  • 二月十六
  • 卖水果的net
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧