Friday, September 14, 2007

Sounds like what?? (Michael Neale)

We have for some time been using the MVEL expression language magic, from Mike Brock. This has served us well, but I found that it has some funky features like "soundex" built in. This allows you to match text based on the soundex algorithm (ie a word sounds like another word).

In 4.0.2, this is available as a proper operator in rules:

Cheese(name soundslike "steelton")

And in the GUI:

You can of course do this in predicates/eval (along with other cool things that MVEL has hidden in it). Handy !

4 comments:

  1. That is funny. The only way I can think of using it in a business case is for spelling suggestion. Back when I worked on SuperPages.com, there was alot of code dedicated to fixing incorrect spellings and bad search parameters.

    Google also employs similar techniques and asks "did you mean blah"?

    ReplyDelete
  2. Hey Mike,
    Does it take into account accent variation and rising inflection?

    Seriously though, this is great addition. Great stuff.
    Nigel

    ReplyDelete
  3. Soundex algorithm is designed for English language, can be best used for finding names with spelling errors (or evolved in spelling over time, for example in real estate title search), but can be used for other words too

    It definitely has limitations,
    google it or read here before using, and don't forget to read the implementation docs

    ReplyDelete
  4. yeah its only for soundex at the moment. So limited to english sounds. It is for spelling errors mainly. Googles technique is to track what people find versus what they were searching for.

    I have no idea how it behaves with crazy accents without trying it. I believe the algorithm was invented by Donald Knuth (but could be wrong).

    ReplyDelete