Skip to content

Commit

Permalink
Doc update
Browse files Browse the repository at this point in the history
  • Loading branch information
Dynom committed Jul 9, 2018
1 parent 247fc2f commit 2467086
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -22,7 +22,7 @@ import "github.com/Dynom/TySug/finder"
```
```go
referenceList := []string{"example", "amplifier", "ample"}
ts := finder.New(referenceList, finder.OptSetAlgorithm(myAlgorithm))
ts := finder.New(referenceList, finder.WithAlgorithm(myAlgorithm))

alt, score := ts.Find("exampel")
// alt = example
Expand Down Expand Up @@ -97,7 +97,7 @@ var someAlgorithm finder.AlgWrapper = func(a, b string) float64 {
return 1 - (score / float64(ml))
}

sug := finder.New([]list, finder.OptSetAlgorithm(someAlgorithm))
sug := finder.New([]list, finder.WithAlgorithm(someAlgorithm))
bestMatch, score := sug.Find(input)
// Here score might be 0.8 for a string of length 10, with 2 mutations
```
Expand Down

0 comments on commit 2467086

Please sign in to comment.