MCPcopy Create free account
hub / github.com/cogentcore/core / calculateRatio

Function calculateRatio

texteditor/difflib/difflib.go:28–33  ·  view source on GitHub ↗
(matches, length int)

Source from the content-addressed store, hash-verified

26)
27
28func calculateRatio(matches, length int) float64 {
29 if length > 0 {
30 return 2.0 * float64(matches) / float64(length)
31 }
32 return 1.0
33}
34
35func listifyString(str string) (lst []string) {
36 lst = make([]string, len(str))

Callers 3

RatioMethod · 0.70
QuickRatioMethod · 0.70
RealQuickRatioMethod · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected