dbTalk Databases Forums  

"Soundex" in FileMaker ?

comp.databases.filemaker comp.databases.filemaker


Discuss "Soundex" in FileMaker ? in the comp.databases.filemaker forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Boubahha
 
Posts: n/a

Default "Soundex" in FileMaker ? - 11-28-2005 , 11:36 AM






Hello,

Is what one among you already tried to implement the function "Soundex" in
FileMaker? http://en.wikipedia.org/wiki/Soundex



Reply With Quote
  #2  
Old   
Howard Schlossberg
 
Posts: n/a

Default Re: "Soundex" in FileMaker ? - 11-28-2005 , 11:52 AM






Boubahha wrote:

Quote:
Is what one among you already tried to implement the function "Soundex" in
FileMaker? http://en.wikipedia.org/wiki/Soundex
There is a sample custom function for FileMaker at
http://www.briandunning.com/cf/265

There are other ones I've also seen out there. These are generally good
for doing one-word finds, but I haven't figured out how to really make
it work for multi-word finds.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg (818) 883-2846
FM Pro Solutions Los Angeles, California

FileMaker 7 Certified Developer
Associate Member, FileMaker Solutions Alliance


Reply With Quote
  #3  
Old   
42
 
Posts: n/a

Default Re: "Soundex" in FileMaker ? - 11-28-2005 , 12:09 PM



In article <438b402a$0$4360$626a54ce (AT) news (DOT) free.fr>, fsdf (AT) fdsfdfds (DOT) com
says...
Quote:
Hello,

Is what one among you already tried to implement the function "Soundex" in
FileMaker? http://en.wikipedia.org/wiki/Soundex
There are a few posts on the subject, and there was even a soundex
plugin -- although i don't know if its being maintained.

That said, under fm7/8 with custom functions it shouldn't even be that
hard now. (Under older versions, it would almost have to be scripts or
plugin, for performance and readibility reasons).

I'd try google & google groups, before you start building your own.


Reply With Quote
  #4  
Old   
Boubahha
 
Posts: n/a

Default Re: "Soundex" in FileMaker ? - 11-29-2005 , 02:56 AM



Thanks for the URL.

I think there is a mistake in the code.
In the algo, we have to Remove Doubles. That fonction works with a simple
double ("bbike"->"bike") but with many doubles ("bbbike"->"bbike")...

Is there another solution.?


"Howard Schlossberg" <howard (AT) antispahm (DOT) fmprosolutions.com> a écrit dans le
message de news: 11omgucmd56ce10 (AT) corp (DOT) supernews.com...
Quote:
Boubahha wrote:

Is what one among you already tried to implement the function "Soundex"
in FileMaker? http://en.wikipedia.org/wiki/Soundex

There is a sample custom function for FileMaker at
http://www.briandunning.com/cf/265

There are other ones I've also seen out there. These are generally good
for doing one-word finds, but I haven't figured out how to really make it
work for multi-word finds.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg (818) 883-2846
FM Pro Solutions Los Angeles, California

FileMaker 7 Certified Developer
Associate Member, FileMaker Solutions Alliance



Reply With Quote
  #5  
Old   
Bill Marriott
 
Posts: n/a

Default Re: "Soundex" in FileMaker ? - 11-29-2005 , 03:06 AM



I'm amazed such a formula was created in the first place, and also impressed
that Harry managed to find it for you.

The beginning part of that formula is simply a long list of substitutions.
You could easily modify it to account for "triple" doubles. So, the solution
is to analyze it and adapt it for your needs.

Bill

"Boubahha" <fsdf (AT) fdsfdfds (DOT) com> wrote

Quote:
Thanks for the URL.

I think there is a mistake in the code.
In the algo, we have to Remove Doubles. That fonction works with a simple
double ("bbike"->"bike") but with many doubles ("bbbike"->"bbike")...

Is there another solution.?


"Howard Schlossberg" <howard (AT) antispahm (DOT) fmprosolutions.com> a écrit dans le
message de news: 11omgucmd56ce10 (AT) corp (DOT) supernews.com...
Boubahha wrote:

Is what one among you already tried to implement the function "Soundex"
in FileMaker? http://en.wikipedia.org/wiki/Soundex

There is a sample custom function for FileMaker at
http://www.briandunning.com/cf/265

There are other ones I've also seen out there. These are generally good
for doing one-word finds, but I haven't figured out how to really make it
work for multi-word finds.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg (818) 883-2846
FM Pro Solutions Los Angeles, California

FileMaker 7 Certified Developer
Associate Member, FileMaker Solutions Alliance





Reply With Quote
  #6  
Old   
Boubahha
 
Posts: n/a

Default Re: "Soundex" in FileMaker ? - 11-29-2005 , 03:14 AM



I've already create that kind of formula, but i've the same problem...

Is there a way to modify doubles ("bbbbbbbbbbbbb..."->"b") ?

"Bill Marriott" <wjm (AT) wjm (DOT) org> a écrit dans le message de news:
eeqdnT2EhbCIhxHenZ2dnUVZ_sCdnZ2d (AT) comcast (DOT) com...
Quote:
I'm amazed such a formula was created in the first place, and also
impressed that Harry managed to find it for you.

The beginning part of that formula is simply a long list of substitutions.
You could easily modify it to account for "triple" doubles. So, the
solution is to analyze it and adapt it for your needs.

Bill

"Boubahha" <fsdf (AT) fdsfdfds (DOT) com> wrote in message
news:438c17c7$0$5976$636a15ce (AT) news (DOT) free.fr...
Thanks for the URL.

I think there is a mistake in the code.
In the algo, we have to Remove Doubles. That fonction works with a simple
double ("bbike"->"bike") but with many doubles ("bbbike"->"bbike")...

Is there another solution.?


"Howard Schlossberg" <howard (AT) antispahm (DOT) fmprosolutions.com> a écrit dans
le message de news: 11omgucmd56ce10 (AT) corp (DOT) supernews.com...
Boubahha wrote:

Is what one among you already tried to implement the function "Soundex"
in FileMaker? http://en.wikipedia.org/wiki/Soundex

There is a sample custom function for FileMaker at
http://www.briandunning.com/cf/265

There are other ones I've also seen out there. These are generally good
for doing one-word finds, but I haven't figured out how to really make
it work for multi-word finds.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg (818) 883-2846
FM Pro Solutions Los Angeles, California

FileMaker 7 Certified Developer
Associate Member, FileMaker Solutions Alliance







Reply With Quote
  #7  
Old   
Bill Marriott
 
Posts: n/a

Default Re: "Soundex" in FileMaker ? - 11-29-2005 , 07:05 AM



It's not a "bug" -- the function was designed to operate as a "simple"
converter.

You could have updated it for triple letters reasonably easy. But you want
the Rolls Royce formula that handles bizarre situations. Ok.

Try this file:

http://www.wjm.org/linked/soundex.zip

Here's the details:

The WikiPedia article on Soundex states that to build the code we must:
========================
1) Retain the first letter of the string
2) Remove all occurrences of the following letters, unless it is the first
letter:

a, e, h, i, o, u, w, y

3) Assign numbers to the remaining letters (after the first) as follows:

b, f, p, v = 1
c, g, j, k, q, s, x, z = 2
d, t = 3
l = 4
m, n = 5
r = 6

4) If two or more letters with the same number were adjacent in the original
name (before step 1), or adjacent except for any intervening h and w, then
omit all but the first.

5) Return the first four bytes padded with 0
========================

I would re-interpret this as follows:

1) Save the first letter/work only with what's left

In the remaining letters,

2) Ditch h and w -- they're completely ignored, they can't even "interrupt"
duplicates

3) Convert e, i, o, u, a, y to 0 -- we need them because they can
"interrupt" a duplicate

4) Convert the rest of the letters to their numbers -- easier to compare
numbers than letter combinationss

5) Distill out any duplicate number runs, eg "11111" down to "1" -- because
we already converted to numbers, we can handle all possible duplicates like
"bffffpppv"

6) Ditch the zeros -- they served their purpose

7) Return the first letter + first three digits + padding if needed

So...

1) Purchase the Developer version of FileMaker 7 or 8. You'll need to use a
recursive custom function. (This is only if you wanna edit or create custom
functions. The file I supplied will let you see the effects of the function
and will work with any version of FileMaker 7 or 8.)

2) Create this custom function (you don't need to enter all the lines
starting with // those are just comments of what the lin above is doing):

UnDup (w)
========
Case (
Get ( ActiveModifierKeys )= 5; "";
// shift-control aborts if recursion goes amok
w="" ; "" ;
// exit if empty
Right(w;1)=" " ; Trim(Right(w;Length(w)-1)) ;
// done; get rid of the trailing space and exit
WordCount(w)=1 ; UnDup("X" & " " & w) ;
// aha, we're ready to start, so turn one word into two
UnDup(
Let ( [
W1=LeftWords(w;1) ;
// Word One (on the left)
W2=RightWords(w;1) ;
// Word Two (on the right)
W3=Right(W2;Length(W2)-1) ;
// Word Two minus its first letter
L1=Right(w1;1) ;
// Last Letter of Word One
L2=Left(w2;1)
// First Letter of Word Two
] ;
If ( L1 = L2;
// Check if they are the same
W1 & " " & W3 ;
// same- leave the left word alone and trim the right one
W1 & L2 & " " & W3 )
// different- add to the left word and still trim the right one
)
)
)

This will distill down any duplicate characters in a single-word string.
Pass single words only! Spaces not allowed

3) Create the field:

SoundEx (calculation, text result) =
===========================
Let ( [
TT =
Substitute ( Lower ( Right ( MyInput; Length ( MyInput ) - 1 ) );

["h";""];["w";""];
["e";0];["i";0];["o";0];["u";0];["a";0];["y";0];
["b";1];["f";1];["p";1];["v";1];
["c";2];["g";2];["j";2];["k";2];["q";2];["s";2];["x";2];["z";2];
["d";3];["t";3];
["l";4];
["m";5];["n";5];
["r";6];
[" ";""]
)
;
T = UnDup (TT)
] ;
Upper(Left(MyInput;1)) &
Left(Substitute (T;0;"") & "000";3))

This calculation converts the string to lowercase, strips out spaces, and
performs the conversion to numbers.

It calls UnDup() to dedup the numbers, then builds the code (stripping out
the zeros that
are no longer needed and adding the zeros that are needed.)

If you don't wish to purchase the Developer version of FileMaker, you can
just use my template. Alternately, The
UnDup() custom function could be accomplished with a script, but I leave
this as an exercise for the student.

Bill

"Boubahha" <fsdf (AT) fdsfdfds (DOT) com> wrote

Quote:
I've already create that kind of formula, but i've the same problem...

Is there a way to modify doubles ("bbbbbbbbbbbbb..."->"b") ?

"Bill Marriott" <wjm (AT) wjm (DOT) org> a écrit dans le message de news:
eeqdnT2EhbCIhxHenZ2dnUVZ_sCdnZ2d (AT) comcast (DOT) com...
I'm amazed such a formula was created in the first place, and also
impressed that Harry managed to find it for you.

The beginning part of that formula is simply a long list of
substitutions. You could easily modify it to account for "triple"
doubles. So, the solution is to analyze it and adapt it for your needs.

Bill

"Boubahha" <fsdf (AT) fdsfdfds (DOT) com> wrote in message
news:438c17c7$0$5976$636a15ce (AT) news (DOT) free.fr...
Thanks for the URL.

I think there is a mistake in the code.
In the algo, we have to Remove Doubles. That fonction works with a
simple double ("bbike"->"bike") but with many doubles
("bbbike"->"bbike")...

Is there another solution.?


"Howard Schlossberg" <howard (AT) antispahm (DOT) fmprosolutions.com> a écrit dans
le message de news: 11omgucmd56ce10 (AT) corp (DOT) supernews.com...
Boubahha wrote:

Is what one among you already tried to implement the function
"Soundex" in FileMaker? http://en.wikipedia.org/wiki/Soundex

There is a sample custom function for FileMaker at
http://www.briandunning.com/cf/265

There are other ones I've also seen out there. These are generally
good for doing one-word finds, but I haven't figured out how to really
make it work for multi-word finds.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Howard Schlossberg (818) 883-2846
FM Pro Solutions Los Angeles, California

FileMaker 7 Certified Developer
Associate Member, FileMaker Solutions Alliance











Reply With Quote
  #8  
Old   
42
 
Posts: n/a

Default Re: "Soundex" in FileMaker ? - 11-29-2005 , 11:55 AM



In article <438c1c0d$0$5977$636a15ce (AT) news (DOT) free.fr>, fsdf (AT) fdsfdfds (DOT) com
says...
Quote:
I've already create that kind of formula, but i've the same problem...

Is there a way to modify doubles ("bbbbbbbbbbbbb..."->"b") ?
I'm curious what practical situation you're trying to cover by handling
13 repeated consonants in a row.

FWIW, yes, you can use recursive custom functions to clean up n-doubles,
but on some level, I don't think english even has a triple, nevermind a
13-tuple.

I mean, I'm all for being complete, robust, and all that... but its ok
to define limits on the input your function will support too.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.