943,735 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Unsolved
  • Views: 6946
  • C# RSS
Aug 18th, 2004
0

Phonematic Name Search in C#

Expand Post »
I just wrote a phonematic name search in C# using the Levenshtein Distance Algorithm. It is very tricky and was quite hard to figure out. This is the samething google uses, and many major search engines. it matches by rank to the text you type in, even if it is mispelled. I believe in open source, and I wrote this for one of my company projects, and with a little simple modification. You can use it for yourself. If you would like a copy of the source. feel free to contact me. Also, I am an expert in .NET so if you need help. Just ask.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
shabosco is offline Offline
2 posts
since Aug 2004
Aug 18th, 2004
0

Re: Phonematic Name Search in C#

It would be nice of you to post something in the code snippets section if it is easy enough to just isolate the relevant code sections. I think many people would be interested in taking a look.


Ed

Quote originally posted by shabosco ...
I just wrote a phonematic name search in C# using the Levenshtein Distance Algorithm. It is very tricky and was quite hard to figure out. This is the samething google uses, and many major search engines. it matches by rank to the text you type in, even if it is mispelled. I believe in open source, and I wrote this for one of my company projects, and with a little simple modification. You can use it for yourself. If you would like a copy of the source. feel free to contact me. Also, I am an expert in .NET so if you need help. Just ask.
Reputation Points: 17
Solved Threads: 1
Junior Poster
cosi is offline Offline
153 posts
since Aug 2004
Jul 1st, 2005
0

Re: Phonematic Name Search in C#

[QUOTE=shabosco]I just wrote a phonematic name search in C# using the Levenshtein Distance Algorithm.

Hi Shabosco, this is arif, i need the source for search file, as am struck in one of my project that rquires the file search. It would be of great pleasure if you could post it to my mail id : arif_829@rediffmail.com.
Thanks in advance
Arif
Reputation Points: 10
Solved Threads: 0
Newbie Poster
arifmd09 is offline Offline
1 posts
since Jul 2005
Jul 20th, 2005
0

Re: Phonematic Name Search in C#

Hi.

Any idea how do i...

i) arrange/sort people's names displayed in a listbox in alphabetical order AND by their surnames?

ii) search for people by name? (my code now can only search by their ID no.)


Thz a lot!
Reputation Points: 10
Solved Threads: 1
Light Poster
c#dummie is offline Offline
38 posts
since Jul 2005
Jul 6th, 2006
0

Re: Phonematic Name Search in C#

Hi there,
I am trying to find person names from text files in DOT NET. Could you help me with some guidelines with your code?
My yahoo id is sandeepiitm@yahoo.com
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sandeepiitm is offline Offline
1 posts
since Jul 2006
Jul 6th, 2006
0

Re: Phonematic Name Search in C#

This might be what you're after.... not 100% sure as just passing through the thread.

It's always worth Googling for Java solutions to these problems. This code took 2min to transpose from Java to C#

My apologise if I've misunderstood what people are after.

C# Syntax (Toggle Plain Text)
  1. public static int GetLavenshteinDistance(string s, string t) {
  2. if (String.IsNullOrEmpty(s) || String.IsNullOrEmpty(t)) throw new ArgumentException("The strings must not be null.");
  3. /*
  4.   * Ported from a Java algorithm by Chas Emerick
  5.   * <a rel="nofollow" href="http://www.merriampark.com/ldjava.htm" target="_blank">http://www.merriampark.com/ldjava.htm</a>
  6.   *
  7.   */
  8. int n = s.Length;
  9. int m = t.Length;
  10. if (n == 0) {
  11. return m;
  12. } else if (m == 0) {
  13. return n;
  14. }
  15. int[] p = new int[n + 1];
  16. int[] d = new int[n + 1];
  17. int[] _d;
  18. char t_j;
  19. int cost;
  20. for (int i = 0; i <= n; i++) {
  21. p[i] = i;
  22. }
  23. for (int j = 1; j <= m; j++) {
  24. t_j = t[j - 1];
  25. d[0] = j;
  26. for (int i = 1; i <= n; i++) {
  27. cost = (s[i - 1] == t_j) ? 0 : 1;
  28. d[i] = Math.Min(Math.Min(d[i - 1] + 1, p[i] + 1), p[i - 1] + cost);
  29. }
  30. _d = p;
  31. p = d;
  32. d = _d;
  33. }
  34. return p[n];
  35. }
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Numen is offline Offline
4 posts
since Jul 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: accessing Open network Ports in C#
Next Thread in C# Forum Timeline: send/received data





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC