Skip to content

Commit

Permalink
Use words package from minio for DamerauLevenshteinDistance() (#2075)
Browse files Browse the repository at this point in the history
  • Loading branch information
balamurugana authored and harshavardhana committed Mar 20, 2017
1 parent 4369359 commit 9ebb916
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
5 changes: 3 additions & 2 deletions cmd/main.go
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Minio Client (C) 2014, 2015 Minio, Inc.
* Minio Client (C) 2014, 2015, 2016, 2017 Minio, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -31,6 +31,7 @@ import (
"github.com/minio/cli"
"github.com/minio/mc/pkg/console"
"github.com/minio/minio/pkg/probe"
"github.com/minio/minio/pkg/words"
"github.com/pkg/profile"
)

Expand Down Expand Up @@ -237,7 +238,7 @@ func findClosestCommands(command string) []string {
continue
}
// 2 is arbitrary and represents the max allowed number of typed errors
if DamerauLevenshteinDistance(command, value.(string)) < 2 {
if words.DamerauLevenshteinDistance(command, value.(string)) < 2 {
closestCommands = append(closestCommands, value.(string))
}
}
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions vendor/vendor.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,12 @@
"revision": "8912b6bf3b22ff668b6448742cd50e7b837182ec",
"revisionTime": "2017-02-10T19:51:41Z"
},
{
"checksumSHA1": "+lLm3Uz721j8WzlV813lWiATrXM=",
"path": "github.com/minio/minio/pkg/words",
"revision": "7ebf11b20233d0eba0f1a28dbd124e7fdd44aee2",
"revisionTime": "2017-03-19T21:23:05Z"
},
{
"path": "github.com/pkg/profile",
"revision": "19396ecfda37c1c9ddaa52019adca59d582e4832",
Expand Down

0 comments on commit 9ebb916

Please sign in to comment.