Skip to content

Commit af34b22

Browse files
authored
Update README.md
1 parent 5ff14e4 commit af34b22

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

README.md

+11
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,14 @@ Partial Ratio tries to match the shoter string to a substring of the longer one
3333
```swift
3434
String.fuzzPartialRatio(str1: "some text here", str2: "I found some text here!") // => 100
3535
```
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
46+
```

0 commit comments

Comments
 (0)