Skip to content

Commit 36ed16b

Browse files
committed
Minor documentation improvement
1 parent 1f91c39 commit 36ed16b

File tree

2 files changed

+12
-8
lines changed

2 files changed

+12
-8
lines changed

internal/mathutil/math.go

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package mathutil
22

3-
// Min returns the value of the smallest argument.
3+
// Min returns the value of the smallest argument,
4+
// or 0 if no arguments are provided.
45
func Min(args ...int) int {
56
if len(args) == 0 {
67
return 0
@@ -19,7 +20,8 @@ func Min(args ...int) int {
1920
return min
2021
}
2122

22-
// Max returns the value of the largest argument.
23+
// Max returns the value of the largest argument,
24+
// or 0 if no arguments are provided.
2325
func Max(args ...int) int {
2426
if len(args) == 0 {
2527
return 0
@@ -38,7 +40,8 @@ func Max(args ...int) int {
3840
return max
3941
}
4042

41-
// Minf returns the value of the smallest argument.
43+
// Minf returns the value of the smallest argument,
44+
// or 0 if no arguments are provided.
4245
func Minf(args ...float64) float64 {
4346
if len(args) == 0 {
4447
return 0
@@ -57,7 +60,8 @@ func Minf(args ...float64) float64 {
5760
return min
5861
}
5962

60-
// Maxf returns the value of the largest argument.
63+
// Maxf returns the value of the largest argument,
64+
// or 0 if no arguments are provided.
6165
func Maxf(args ...float64) float64 {
6266
if len(args) == 0 {
6367
return 0

internal/ngram/ngram.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,10 @@ func Map(runes []rune, size int) (map[string]int, int) {
6666

6767
// Intersection returns a map of the n-grams of the specified size found
6868
// in both terms, along with their frequency. The function also returns the
69-
// number of common n-grams (the sum of all the values in the output map), the
70-
// total number of n-grams in the first term and the total number of n-grams in
71-
// the second term. An n-gram size of 1 is used if the provided size is less
72-
// than or equal to 0.
69+
// number of common n-grams (the sum of all the values in the output map),
70+
// the total number of n-grams in the first term and the total number of
71+
// n-grams in the second term. An n-gram size of 1 is used if the provided
72+
// size is less than or equal to 0.
7373
func Intersection(a, b []rune, size int) (map[string]int, int, int, int) {
7474
// Use an n-gram size of 1 if the provided size is invalid.
7575
size = mathutil.Max(size, 1)

0 commit comments

Comments
 (0)