惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Microsoft Azure Blog
Microsoft Azure Blog
大猫的无限游戏
大猫的无限游戏
月光博客
月光博客
V
V2EX
PCI Perspectives
PCI Perspectives
Latest news
Latest news
博客园 - 三生石上(FineUI控件)
C
CERT Recently Published Vulnerability Notes
W
WeLiveSecurity
Last Week in AI
Last Week in AI
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
P
Palo Alto Networks Blog
T
The Exploit Database - CXSecurity.com
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
WordPress大学
WordPress大学
V
Vulnerabilities – Threatpost
H
Heimdal Security Blog
Attack and Defense Labs
Attack and Defense Labs
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Hacker News: Ask HN
Hacker News: Ask HN
博客园 - 叶小钗
V
Visual Studio Blog
Jina AI
Jina AI
P
Proofpoint News Feed
罗磊的独立博客
SecWiki News
SecWiki News
J
Java Code Geeks
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
L
LINUX DO - 热门话题
Security Archives - TechRepublic
Security Archives - TechRepublic
The Hacker News
The Hacker News
Hugging Face - Blog
Hugging Face - Blog
N
News and Events Feed by Topic
NISL@THU
NISL@THU
T
Tailwind CSS Blog
T
Tenable Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Recent Announcements
Recent Announcements
H
Hacker News: Front Page
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
T
Tor Project blog
宝玉的分享
宝玉的分享
Help Net Security
Help Net Security
S
Security Affairs
Microsoft Security Blog
Microsoft Security Blog
Google DeepMind News
Google DeepMind News
F
Fortinet All Blogs
G
GRAHAM CLULEY

博客园 - DotCat

幽默的David Solomon MSDN上ReportViewer的两个代码下载地址 .NET threading in C# Training Highlights sharing Converting RDL and RDLC Files VS打SP1后reportviewer用custom assembly的变化 Meet 牛人 @ April: Jeffrey Richter & David Solomon 当你聊天你会想起谁--Vista Sidebar Gadget DIY 哈,IE7!--dudu的CNBlogs DotText 1.0 Beta 2中FreeTextBox对IE7的不兼容性 CCS bug之8: 有关设置精华帖的操作在帖子的操作历史里浏览出错 CCS bug之7: 设置精华帖后在精华区不能看到 MSN和Windows Live Messenger机器人大赛 [CodeProject每日一荐]实现Double Metaphone语音匹配算法[二]:Visual Basic的COM实现和关系数据库解决方案 [CodeProject每日一荐]实现Double Metaphone语音匹配算法[一]:介绍与C++实现 [CodeProject每日一荐] 基于xml的在线选择题小测试(调查问卷) 解决问题: .Net异常 Method not found: Void System.Web.UI.WebControls.BaseDataList.set_Caption(System.String). 解决问题: sql server 2000 企业管理器打不开了 推荐解除文件锁定软件: unlocker CuteChat3.0 (for CommunityServer2.0) 发布了 CommunityServer 2.1 的消息
[CodeProject每日一荐]实现Double Metaphone语音匹配算法[三,四] VBScript调用COM;存储过程实现及高级话题
DotCat · 2006-06-09 · via 博客园 - DotCat

Implement Phonetic ("Sounds-like") Name Searches with Double Metaphone Part III: VBScript and ASP & Database Solutions By Adam Nelson

[三] 就一笔带过了:因为VB只是类型化的变量,而脚本语言是无类型的.所以COM必须为脚本语言单独实现一个版本,然后在脚本语言VBcript,JScript,以及ASP里面的VBcript就可以调用了.

Implement Phonetic ("Sounds-like") Name Searches with Double Metaphone Part IV: SQL Server and Advanced Database Topics By Adam Nelson

[四] 还蛮有意思的.作为数据库开发人员出身的作者(作者语),推介了存储过程的种种好处,并展示了用Sql Server的使用技巧.

[使用存储过程]
SQL Server的扩展存储过程是用 Win32 DLL的. 安装只需把DLL复制到SQL Server 安装目录的Binn 的目录下,然后在master数据库运行sp_addextendedproc,如
use master
exec sp_addextendedproc ‘xp_metaphone’, ‘XPMetaphone.dll’
存储过程只做了采用unsigned short 的优化版本.预先把key都算出来存起来,就可以使用select语句来查询了.

[创建集簇索引]
一个表只能创建一个集簇索引列,让物理存储上按该列排序,在数据规模很大时肯定要使用的.如果是把语音key和应用程序其他信息存在一张表里,key往往没有重要到建集簇索引的份.

[减少与现有程序数据表的耦合]
把语音key单独存个表,至少就可以有个集簇索引列了,这种建立数据库的方法减少耦合,当然是好的.

[用触发器更新key]
算法可能会变,新词来了也需要插入key.使用更新和插入时的触发器来维护单词的相应key

[在select里给匹配打分]
(译者:这种case平时我都忽略了,久了不用简直都遗忘了)

select 
word,
(
case 
     
when key1 = @primaryKey then 
     
1--Strong match

     
when key2 = @primaryKey then
     
2--Normal match

     
when key1 = @alternateKey then
     
2--Normal match

     
when key2 = @alternateKey then
     
3--Minimal match

     
else
     
4--No match
end
as matchScore
from Words
where
     key1 
= @primaryKey
     
or
     key2 
= @primaryKey
     
or
     key1 
= @alternateKey
     
or
     key2 
= @alternateKey
order by word
go

[把搜索逻辑也封装在存储过程中]
这下彻底了,应用程序只需简单调用一条存储过程,不用再拼sql语句什么的了,代码重用又一招.