Skip to content

Instantly share code, notes, and snippets.

Avatar
📱
iOS for life

Kristina Fox krstnfx

📱
iOS for life
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am krstnfx on github.
  • I am kristina (https://keybase.io/kristina) on keybase.
  • I have a public key whose fingerprint is D33A 5FF7 8685 93E2 56BF 1789 11AA FAAA CAA1 3850

To claim this, I am signing this object:

@krstnfx
krstnfx / Levenshtein
Last active Aug 29, 2015 — forked from quietcricket/gist:1593632
Levenshtein to get edit distance between two strings (ignores newlines, but counts spaces)
View Levenshtein
-(float)compareString:(NSString *)originalString withString:(NSString *)comparisonString
{
// Normalize strings
[originalString stringByTrimmingCharactersInSet:[NSCharacterSet newlineCharacterSet]];
[comparisonString stringByTrimmingCharactersInSet:[NSCharacterSet newlineCharacterSet]];
originalString = [originalString lowercaseString];
comparisonString = [comparisonString lowercaseString];
// Step 1 (Steps follow description at http://www.merriampark.com/ld.htm)