Skip to content

Commit e285d6d

Browse files
committed
Fix function comments based on best practices from Effective Go
Signed-off-by: CodeLingo Bot <[email protected]>
1 parent 02a5189 commit e285d6d

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

errorcorrect.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ var LowercaseLetters = []byte{
6262
111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122,
6363
}
6464

65-
// Returns all byte-arrays which are Levenshtein distance of 1 away from Word
65+
// ErrorCorrect returns all byte-arrays which are Levenshtein distance of 1 away from Word
6666
// within an allowed array of byte characters.
6767
func ErrorCorrect(Word []byte, AllowedBytes []byte) [][]byte {
6868
results := make([][]byte, 0)

ferret.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ func New(Words, Results []string, Data []interface{}, Converter func(string) []b
101101
return Suffixes
102102
}
103103

104-
// Adds a word to the dictionary that IS was built on.
104+
// Insert adds a word to the dictionary that IS was built on.
105105
// This is pretty slow, because of linear-time insertion into an array,
106106
// so stick to New when you can
107107
func (IS *InvertedSuffix) Insert(Word, Result string, Data interface{}) {
@@ -201,7 +201,7 @@ func (IS *InvertedSuffix) Search(Query []byte) (int, int) {
201201
return low, high
202202
}
203203

204-
// Returns the strings which contain the query, and their stored values unsorted
204+
// Query returns the strings which contain the query, and their stored values unsorted
205205
// Input:
206206
// Word: The substring to search for.
207207
// ResultsLimit: Limit the results to some number of values. Set to -1 for no limit
@@ -234,7 +234,7 @@ func (IS *InvertedSuffix) Query(Word string, ResultsLimit int) ([]string, []inte
234234
return Results, Values
235235
}
236236

237-
// Returns the strings which contain the query sorted
237+
// SortedQuery returns the strings which contain the query sorted
238238
// The function sorter produces a value to sort by (largest first)
239239
// Input:
240240
// Word: The substring to search for.
@@ -308,7 +308,7 @@ func (IS *InvertedSuffix) SortedQuery(Word string, ResultsLimit int, Sorter func
308308
return Results, Values, Scores
309309
}
310310

311-
// Returns the strings which contain the query
311+
// ErrorCorrectingQuery returns the strings which contain the query
312312
// Unsorted, I think it's partially sorted alphabetically
313313
// Will search for all substrings defined by ErrorCorrection
314314
// if no results are found on the initial query
@@ -363,7 +363,7 @@ func (IS *InvertedSuffix) ErrorCorrectingQuery(Word string, ResultsLimit int, Er
363363
return Results, Values
364364
}
365365

366-
// Returns the strings which contain the query
366+
// SortedErrorCorrectingQuery returns the strings which contain the query
367367
// Sorted. The function sorter produces a value to sort by (largest first)
368368
// Will search for all substrings defined by ErrorCorrection
369369
// if no results are found on the initial query

0 commit comments

Comments
 (0)