473,399 Members | 3,401 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

String matching (Inteligent)

Hey

I need a string comparison algorithm which can comapre 2 strings and come
with a number, eg %, which indicates how much the string a alike.

I could of course just comapre the number of occurences of each letter, but
then aab woudl be equal aba. This is not good enough. So the algorithm also
has to compare closeness og letters etc.

I hope i can find a "finished" or skeleton algorithm since i am convicnced
that other, which have the time, could implement this much better than me.

Optimally i want something like this:
double closeness = SuperComparere("My string", "My strong"); // returns eg.
93%

Anyone heard about above and know sources for solutions?

Kindly Regards
Anders
Sep 26 '06 #1
4 1463
<"anderskj1" <none>wrote:
I need a string comparison algorithm which can comapre 2 strings and come
with a number, eg %, which indicates how much the string a alike.

I could of course just comapre the number of occurences of each letter, but
then aab woudl be equal aba. This is not good enough. So the algorithm also
has to compare closeness og letters etc.

I hope i can find a "finished" or skeleton algorithm since i am convicnced
that other, which have the time, could implement this much better than me.

Optimally i want something like this:
double closeness = SuperComparere("My string", "My strong"); // returns eg.
93%

Anyone heard about above and know sources for solutions?
I haven't done anything similar myself, but
http://en.wikipedia.org/wiki/Fuzzy_string_searching
might be useful to you.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Sep 26 '06 #2
I need a string comparison algorithm which can comapre 2 strings and come
with a number, eg %, which indicates how much the string a alike.
What you are referring to is a rather difficult topic. I think (but am
not sure) that many SQL dbms systems provide something alike, but they
need to index the searchable data every once in a while. (PS: found it
at wikipedia,
http://en.wikipedia.org/wiki/SQL_Ser...l_Text_Search).

Anyways, the only thing I can really contribute to this thread is that
I think you should search for some code (.NET or 3rd party) that does
this, as it's a difficult task. Perhaps the Regex libraries provide
some help.

Good luck. Let us know what you chose to do.

Sep 26 '06 #3
This is a common operation when working with DNA/protein sequences.

There are many free tools/algorithms you should be able to steal
inspiration from.

One starting point could be:
http://en.wikipedia.org/wiki/Sequence_alignment

/Per

Sep 26 '06 #4
Hi

Take a look on Google for Levenstein (think that's spelt correctly)
Distance Calculation - from memory it sounds remarkably close to what
you're after

Cheers
Martin
pe*****@gmail.com wrote:
This is a common operation when working with DNA/protein sequences.

There are many free tools/algorithms you should be able to steal
inspiration from.

One starting point could be:
http://en.wikipedia.org/wiki/Sequence_alignment

/Per
Sep 26 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: Xah Lee | last post by:
# -*- coding: utf-8 -*- # Python # Matching string patterns # # Sometimes you want to know if a string is of # particular pattern. Let's say in your website # you have converted all images...
0
by: Tom Warren | last post by:
I found a c program called similcmp on the net and converted it to vba if anybody wants it. I'll post the technical research on it if there is any call for it. It looks like it could be a useful...
19
by: Paul | last post by:
hi, there, for example, char *mystr="##this is##a examp#le"; I want to replace all the "##" in mystr with "****". How can I do this? I checked all the string functions in C, but did not...
10
by: javuchi | last post by:
I'm searching for a library which makes aproximative string matching, for example, searching in a dictionary the word "motorcycle", but returns similar strings like "motorcicle". Is there such a...
5
by: olaufr | last post by:
Hi, I'd need to perform simple pattern matching within a string using a list of possible patterns. For example, I want to know if the substring starting at position n matches any of the string I...
4
by: anderskj1 | last post by:
Hey I need a string comparison algorithm which can comapre 2 strings and come with a number, eg %, which indicates how much the string a alike. I could of course just comapre the number of...
9
by: | last post by:
I am interested in scanning web pages for content of interest, and then auto-classifying that content. I have tables of metadata that I can use for the classification, e.g. : "John P. Jones" "Jane...
0
NeoPa
by: NeoPa | last post by:
ANSI-89 v ANSI-92 Before we get into all the various types of pattern matching that can be used, there are two ANSI standards used for the main types of wildcard matching (matching zero or more...
11
by: tech | last post by:
Hi, I need a function to specify a match pattern including using wildcard characters as below to find chars in a std::string. The match pattern can contain the wildcard characters "*" and "?",...
1
by: Ben | last post by:
I apologize in advance for the newbie question. I'm trying to figure out a way to find all of the occurrences of a regular expression in a string including the overlapping ones. For example,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.