Similar indicates whether two symbols are similar and may be represented by using the Modified type. As a special case, we consider binary comparisons (i.e., those that return Result{1, 0} or Result{0, 1}) to be similar. The exact ratio of NumSame to NumDiff to determine similarity may change.
()
| 115 | // |
| 116 | // The exact ratio of NumSame to NumDiff to determine similarity may change. |
| 117 | func (r Result) Similar() bool { |
| 118 | // Use NumSame+1 to offset NumSame so that binary comparisons are similar. |
| 119 | return r.NumSame+1 >= r.NumDiff |
| 120 | } |
| 121 | |
| 122 | var randBool = rand.New(rand.NewSource(time.Now().Unix())).Intn(2) == 0 |
| 123 |
no outgoing calls