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

推荐订阅源

酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hacker News: Front Page
P
Palo Alto Networks Blog
T
ThreatConnect
Apple Machine Learning Research
Apple Machine Learning Research
博客园_首页
T
True Tiger Recordings
P
Privacy & Cybersecurity Law Blog
B
Blog
IT之家
IT之家
Last Week in AI
Last Week in AI
F
Full Disclosure
Hacker News: Ask HN
Hacker News: Ask HN
C
Comments on: Blog
Microsoft Azure Blog
Microsoft Azure Blog
C
Cybersecurity and Infrastructure Security Agency CISA
Microsoft Security Blog
Microsoft Security Blog
博客园 - 【当耐特】
N
News and Events Feed by Topic
NISL@THU
NISL@THU
腾讯CDC
雷峰网
雷峰网
Security Latest
Security Latest
李成银的技术随笔
M
Microsoft Research Blog - Microsoft Research
L
LangChain Blog
L
Lohrmann on Cybersecurity
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
C
Check Point Blog
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
博客园 - Franky
N
News | PayPal Newsroom
V
V2EX
A
About on SuperTechFans
The Register - Security
The Register - Security
月光博客
月光博客
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Google Online Security Blog
Google Online Security Blog
MyScale Blog
MyScale Blog
Cisco Talos Blog
Cisco Talos Blog
Vercel News
Vercel News
WordPress大学
WordPress大学
C
Cyber Attacks, Cyber Crime and Cyber Security
The Hacker News
The Hacker News
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
IntelliJ IDEA : IntelliJ IDEA – the Leading IDE for Professional Development in Java and Kotlin | The JetBrains Blog
爱范儿
爱范儿
A
Arctic Wolf
L
LINUX DO - 最新话题
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - 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 - DotCat 哈,IE7!--dudu的CNBlogs DotText 1.0 Beta 2中FreeTextBox对IE7的不兼容性 - DotCat CCS bug之8: 有关设置精华帖的操作在帖子的操作历史里浏览出错 - DotCat 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语句什么的了,代码重用又一招.