• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Does anyone have a clever algorithim, string search

Enthusiast ,
Jan 27, 2009 Jan 27, 2009

Copy link to clipboard

Copied

I have an array of 8 strings. I accept a user string and return the closest match from the array. Does anyone have a clever algorithim that will do this?
TOPICS
Advanced techniques

Views

374

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 27, 2009 Jan 27, 2009

Copy link to clipboard

Copied

Where does the array come from?

What criteria do you use for best match?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jan 27, 2009 Jan 27, 2009

Copy link to clipboard

Copied

I make the array in CF, I'm not really sure of the critiria, I want it to work like Google search results:

"Did you mean HBOS intead of hboss"

you know what i mean 🙂

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Jan 27, 2009 Jan 27, 2009

Copy link to clipboard

Copied

Also exact matches from the user string say, "hbos" will not need to be tested for closeness to the values in the test array as hbos is already a value.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jan 27, 2009 Jan 27, 2009

Copy link to clipboard

Copied

LATEST
> I make the array in CF, I'm not really sure of the critiria, I want it to work like Google search results:
>
> "Did you mean HBOS intead of hboss"

>> Does anyone have a clever algorithim that will do this?

Yep. The people who own Google and make their living providing such
servcices.

Or the bods who wrote Lucene or Verity have a clue or two, too.

You're basically asking us if we know how to write a search engine. My
suggestion would be to not try to reinvent the wheel, but use one of the
systems already out there.

Google appliances costs a fair bit, but Lucene is free, and CF bundles
Verity with it. I recommend you use one of those two.

--
Adam

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation