You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+11
Original file line number
Diff line number
Diff line change
@@ -33,3 +33,14 @@ Partial Ratio tries to match the shoter string to a substring of the longer one
33
33
```swift
34
34
String.fuzzPartialRatio(str1: "some text here", str2: "I found some text here!") // => 100
35
35
```
36
+
### Token Sort Ratio
37
+
Split strings by white space into arrays of tokens. Sort two arrays of Tokens. Calculate the effort needed to transform on arry of token into another. Characters other than letters and numbers are removed as a pre-processing by default.
38
+
```swift
39
+
String.fuzzTokenSortRatio(str1: "fuzzy wuzzy was a bear", str2: "wuzzy fuzzy was a bear") // => 100
40
+
41
+
String.fuzzTokenSortRatio(str1: "fuzzy+wuzzy(was) a bear", str2: "wuzzy fuzzy was a bear") // => 100
42
+
```
43
+
set fullProcess to false to remove this pre-processing
44
+
```swift
45
+
String.fuzzTokenSortRatio(str1: "fuzzy+wuzzy(was) a bear", str2: "wuzzy fuzzy was a bear", fullProcess: false) // => 77
0 commit comments