Of crs, I saw it. I meant "abcdef" = "abcdefxyzxyz", no referring to human names. Secondly, my exact taste is: CompareText(txt1, txt2) => LCS(txt1, txt2) / MAX(Len(txt1), Len(txt2)) * 100%, where LCS is Longest Common Subsequence of txt1 and txt2: http://en.wikipedia.org/wiki/Longest_common_subsequence And of course it's slow (O(n*m)):

CREATE FUNCTION mf_LCSLength
(
@x varchar(8000),
@y varchar(8000)
)
returns int
AS
/*
Computing the length of the LCS: http://en.wikipedia.org/wiki/Longest_common_subsequence
The below function takes as input sequences X[1..m] and Y[1..n] computes the LCS
between X[1..i] and Y[1..j] for all 1 = i = m and 1 = j = n, and stores it in
C[i,j]. C[m,n] will contain the length of the LCS of X and Y.
function LCSLength(X[1..m], Y[1..n])
C = array(0..m, 0..n)
for i := 0..m
C[i,0] = 0
for j := 0..n
C[0,j] = 0
for i := 1..m
for j := 1..n
if X[i] = Y[j]
C[i,j] := C[i-1,j-1] + 1
else:
C[i,j] := max(C[i,j-1], C[i-1,j])
return C[m,n]
*/
BEGIN
declare @i int
declare @j int
declare @p int
declare @q int
declare @n int
declare @m int
declare @t table (m int, a int, b int)
select @n = len(@x), @m = len(@y), @i = 0
while @i <= @m
begin
insert into @t select @i, 0, 0
set @i = @i + 1
end
set @i = 1
while @i <= @n
begin
set @j = 1
while @j <= @m
begin
if substring(@x, @i, 1) = substring(@y, @j, 1)
update @t set b = (select a from @t where m = @j - 1) + 1 where m = @j
else
begin
select @p = a from @t where m = @j
select @q = b from @t where m = @j - 1
if @p < @q set @p = @q
update @t set b = @p where m = @j
end
set @j = @j + 1
end
update @t set a = b
set @i = @i + 1
end
RETURN(select max(b) from @t)
END
set nocount on
declare @x varchar(8000)
declare @y varchar(8000)
select
@x = 'yupgayyeuntubajfncjxeyupxbpxfnxbntuxlyaludskiufntukonoyapanonaxlfojup',
@y = 'hfoqujhexjalicjxeyupfxpunapufangayyeualnujufnalibjxpntunapuhxsnjhannxntunapuhxsfxyqua'
select
@x=lower(@x), --@x=replace(@x,'a',''),@x=replace(@x,'e',''),@x=replace(@x,'i',''),@x=replace(@x,'o',''),@x=replace(@x,'u',''),
@y=lower(@y)--, @y=replace(@y,'a',''),@y=replace(@y,'e',''),@y=replace(@y,'i',''),@y=replace(@y,'o',''),@y=replace(@y,'u','')
select 'blindman:', dbo.CompareText(@x,@y)
select 'stoad:', 100.0*dbo.mf_LCSLength(@x,@y)/case when len(@x)>len(@y) then len(@x) else len(@y) end
--------- -----------
blindman: 45
------------- ----------------------------
stoad: 38.823529411764
-------------------------------------------------------------------------
WITHOUT VOWELES:
--------- ---------------------------------------------------------------
blindman: 39
------------- ----------------------------
stoad: 40.350877192982

Astounding. Until now, the realm of DBAs has been nearly devoid of business buzzwords. But Certus, in a single thread, has greatly expanded our lexicon. Little Gems such as "Pactory", "Tractory", "Enactory", and "Exactory" start showing up around post #64, and he throws in "heterarchically" later on. Thanks to his "EAV On Steroids" database design, we can finally hold our own when talking to mid-level managers. http://www.dbforums.com/showthread.php?t=1633864&page=5

But it leaves so many questions unanswered! What about the semantics in the underlying model theory? What notions of reification are there? How does that link in with context and provenance? (Actually, it's quite possible these were all discussed: I didn't read any more than the posts on the linked page).

I suspect he is developing some kind of super "Entity Attribute Vocabulary" (EAV), where words themselves have no meaning except in relation to other words, thus saving us the tedious overhead of dictionaries. Now, anybody will be able to define any word to mean anything they want, without having to worry about restrictions such as grammar or spelling. Eventually, we will only need one word: "Marklar".

Astounding. Until now, the realm of DBAs has been nearly devoid of business buzzwords. But Certus, in a single thread, has greatly expanded our lexicon. Little Gems such as "Pactory", "Tractory", "Enactory", and "Exactory" start showing up around post #64, and he throws in "heterarchically" later on. Thanks to his "EAV On Steroids" database design, we can finally hold our own when talking to mid-level managers. http://www.dbforums.com/showthread.php?t=1633864&page=5

Boycotted Beijing Olympics 2008

That "design" seems perfectly engineered to generate a steady stream of consulting revenue.

I’m sure we will soon get posts where someone tries to implement it in SQL Server. "Help, every query I write with this database is 4,000 lines long, takes days to run, and tells me my inventory quantity on-hand is “Light Blue".

Edit: Has anyone ever mentioned to the EVA designers that SQL Server has all that stuff built-in and supported directly by the database engine: sysobjects, syscolumns, systypes, sysreferences, sysconstraints, etc. Just saying...

CODO ERGO SUM

Edited by - Michael Valentine Jones on 09/25/2008 11:03:43