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

推荐订阅源

博客园_首页
Blog — PlanetScale
Blog — PlanetScale
腾讯CDC
aimingoo的专栏
aimingoo的专栏
Microsoft Azure Blog
Microsoft Azure Blog
A
About on SuperTechFans
J
Java Code Geeks
G
Google Developers Blog
N
Netflix TechBlog - Medium
Vercel News
Vercel News
Y
Y Combinator Blog
Recent Announcements
Recent Announcements
I
InfoQ
Stack Overflow Blog
Stack Overflow Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
T
The Blog of Author Tim Ferriss
罗磊的独立博客
GbyAI
GbyAI
小众软件
小众软件
大猫的无限游戏
大猫的无限游戏
WordPress大学
WordPress大学
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More

博客园 - VeryDxZ

创业公司做数据分析(转载) 初始化一台linux server来做项目管理和测试 Tanglement, although optional 灰常不错的SC2剧情分析 Sketching & Story telling [VBA] 1-MSScriptControl 2-JSON Got the whole picture of what I'm doing 自用Excel VBA技巧整理 - VeryDxZ - 博客园 自用Excel VBA函数整理 part2 自用Excel VBA函数整理 part1 论文没抽中盲检,心情爽多了 又到了Intern大批离职的时候,真伤感额 几个提高Windows(主要是XP)桌面产能的小软件 好久不碰Blog,最近要二次毕业了,继续写点警醒自己的话 Michael Joseph Jackson (August 29, 1958 – June 25, 2009) 第一次租房子,人生哦~ Me on twitter Collective Intelligence,一个牛逼的新马甲 许久没认真上网,发现网络还是挺有正面用途的
自用Excel VBA函数整理 part3
VeryDxZ · 2010-10-16 · via 博客园 - VeryDxZ

'http://en.wikipedia.org/wiki/Levenshtein_distance
Public Function EditDistance(s, t, Optional costIns As Integer = 1, Optional costDel As Integer = 1, Optional costSub As Integer = 1) As Integer
    'declaration, d(i,j) will hold the Levenshtein distance between
    'the first i chars of s and the first j chars ot t
    Static d(0 To EDIT_DISTANCE_CACHE, 0 To EDIT_DISTANCE_CACHE) As Integer
    
    'initialization, note that (m+1)*(n+1) distances is used
    m = Len(s): n = Len(t)
    For x = 0 To m
        For y = 0 To n
            d(x, y) = 0
        Next y
    Next x
    
    'source prefixes can be transformed into empty string by dropping all chars
    For i = 1 To m
        d(i, 0) = i * costDel
    Next i
    'target prefixes can be reached from empty source prefix by inserting every chars
    For j = 1 To n
        d(0, j) = j * costIns
    Next j
    
    For j = 1 To n
        For i = 1 To m
            If Mid(s, i, 1) = Mid(t, j, 1) Then
                d(i, j) = d(i - 1, j - 1)
            Else
                d(i, j) = WorksheetFunction.Min( _
                    d(i - 1, j) + costDel, _
                    d(i, j - 1) + costIns, _
                    d(i - 1, j - 1) + costSub)
            End If
        Next i
    Next j
    EditDistance = d(m, n)
End Function

EditDistance

Example of workbook already enabled:
1. JSON
2. XmlHttp (via usage of API for Geocoding) 
3. Geo Distance Calculation From Lng & Lat
[Download Here]