Board: 5789.com Development

Subject

Re: Metaphone source code?

Author

William Chesters

Status

Date

17/03/2000 21:46

Message

[Paneris people: read on]
William Brogden writes:
> Here is the source and example data. The only problem I know of
> is that terminal "mb" phonem is not getting turned into "m"
> as in numb or dumb. Please feel free to use it however you like.
Thanks! I fixed ...MB as follows, and since the only example I could
think of was McCombe, I added a rule to treat ...MBE similarly.
case 'B' :
if(!(n > 0 && local.charAt(n - 1) == 'M' &&
(n + 1 == wdsz ||
(n + 2 == wdsz && local.charAt(n + 1) == 'E')))) {
// not MB or MBE at end of word
code.append(symb);
mtsz++ ;
}
break ;
I also fixed a bug in the handling of `K' which led to some too-short
codes being generated:
case 'K' :
if( n > 0 ){ // not initial
if( local.charAt( n -1) != 'C' ) {
code.append(symb );
mtsz++ ;
}
}
else {
code.append( symb ); // initial K
mtsz++ ;
}
break ;
A quick summary for the Paneris people: this is a word -> canonical
pronunciation scheme that produces better matches than Soundex. See
William's page at http://www.bga.com/~wbrogden for a description of
the algorithm.
Overall Metaphone finds 1132 categories in the 1895 (mostly very
strange) girls' names while Soundex finds 762. Soundex often throws
you back a pretty long list of poor matches, while Metaphone is more
discriminating. Sometimes Metaphone is a little more discriminating
than some searchers will want (see Jacqueline, ... versus Jackelyn,
.... below) but mostly it works well.
My recommendation is that we go with Metaphone, since for our
application people are going to have a reasonable idea of the name and
they are going to hate having 46 alleged "possibilities"---including
such disparate names as Gillian, Jolene and Jacqueline---all thrown
back into their phones!
Below is a random sample of the algorithm in action on some girls'
names, versus Soundex.
"Jolene":
JLN -> Gillan Gillian Jelene Jillana Jillane Jillayne Jilleen Jillene Jillian Joellen Joellyn Joelynn Joleen Jolene Joline Jolyn Jolynn Juliana Juliane Juliann Julianna Julianne Julienne Julina Juline
j450 -> Jackelyn Jacklin Jacklyn Jackquelin Jackqueline Jaclin Jaclyn Jacquelin Jacqueline Jacquelyn Jacquelynn Jaquelin Jaquelyn Jelene Jessalin Jessalyn Jesselyn Jillana Jillane Jillayne Jilleen Jillene Jillian Jocelin Joceline Jocelyn Jocelyne Joellen Joellyn Joelynn Joleen Jolene Joline Jolyn Jolynn Joscelin Josselyn Joycelin Juliana Juliane Juliann Julianna Julianne Julienne Julina Juline
--- Both do well on Jolene and friends. Both have included Gillian in
the same class (bad) but Metaphone has correctly brought Jillian in
too rather than putting it in a separate category (good). SOUNDEX has
included Jacqueline etc. (bad), while Metaphone has divided them
between two other groups:
JKKL -> Jackquelin Jackqueline Jacquelin Jacqueline Jacquelyn Jacquelynn
JKLN -> Jackelyn Jacklin Jacklyn Jaclin Jaclyn Jaquelin Jaquelyn
which is arguably pretty good if you have a vague feeling about which
sort of Jacqueline you remember.
With "Catherine", Metaphone includes Katherine but not Catarina while
SOUNDEX does the reverse:
K0RN -> Catharina Catharine Catherin Catherina Catherine Cathrin Cathrine Cathryn Cthrine Katharina Katharine Katharyn Katherina Katherine Katheryn Kathrine Kathryn Kathryne
c365 -> Caitrin Catarina Caterina Catharina Catharine Catherin Catherina Catherine Cathrin Cathrine Cathryn Catrina Catriona Cthrine
Couple more: Metaphone clearly wins on "Anna-Maria", since Amara, Annora etc. are noise:
ANMR -> Ann-Marie Anna-Maria Annamaria Annamarie Anne-Marie Annemarie Annmaria Annmarie
a560 -> Amara Ammamaria Ann-Marie Anna-Maria Annamaria Annamarie Anne-Marie Annemarie Annmaria Annmarie Annnora Annora
With "Rachel", Metaphone makes a pretty sensible smaller category.
Again, if you knew you were after Rachael or Rachelle rather than
Raquel you would be happy. At least you don't get Rosalia back.
RXL -> Rachael Rachel Rachele Rachelle Raychel Rayshell Rochell Rochella Rochelle Roshelle
r240 -> Rachael Rachel Rachele Rachelle Rakel Raquel Raquela Rasla Raychel Rayshell Rochell Rochella Rochelle Rosalia Rosalie Roselia Rosella Roselle Roshelle Rozalie Rozele Rozella Rozelle

5789.com Development Board

 

Post Follow-up

Search This Board

 

Message Context:

SOUNDEX Tim Joyce 15/03/2000 16:31

    SOUNDEX William Chesters 17/03/2000 18:44

        Re: SOUNDEX Tim Joyce 17/03/2000 20:28

            Re: SOUNDEX William Chesters 17/03/2000 21:55

                Re: SOUNDEX Tim Joyce 18/03/2000 07:04

                    Re: SOUNDEX William Chesters 18/03/2000 10:40

                        Re: SOUNDEX Tim Joyce 19/03/2000 08:24

                Re: SOUNDEX Tim Joyce 07/08/2000 12:36

                    Re: SOUNDEX Tim Joyce 07/08/2000 13:27

        Re: Metaphone source code? William Chesters 17/03/2000 21:46



Home -  News -  Reference Sites -  Members -  Partners -  Guidelines -  Philosophy -  Your Details -  Logout