Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Comparing two strings

    Hello Stata listers,

    I am matching last names across two datasets. I know lots of packages have been developed for this, but I rather do my own thing. Is there an easy way to easily compare two strings that goes beyond soundex. Maybe ignoring character order, returning the "difference" between the character in the strings?

    Pierre

  • #2
    It kinda depends on what you're doing, but see https://en.wikipedia.org/wiki/Levenshtein_distance

    Edit: Reading the wikipedia article, I didn't realize this is a dynamic programming problem! Pretty cool!
    Last edited by Daniel Schaefer; 07 Aug 2023, 14:58.

    Comment

    Working...
    X