MCPcopy Create free account
hub / github.com/brimdata/super / Call

Method Call

runtime/sam/expr/function/string.go:201–215  ·  view source on GitHub ↗
(args []super.Value)

Source from the content-addressed store, hash-verified

199}
200
201func (l *Levenshtein) Call(args []super.Value) super.Value {
202 args = underAll(args)
203 a, b := args[0], args[1]
204 if a.IsNull() || b.IsNull() {
205 return super.Null
206 }
207 if !a.IsString() {
208 return l.sctx.WrapError("levenshtein: string args required", a)
209 }
210 if !b.IsString() {
211 return l.sctx.WrapError("levenshtein: string args required", b)
212 }
213 as, bs := super.DecodeString(a.Bytes()), super.DecodeString(b.Bytes())
214 return super.NewInt64(int64(levenshtein.ComputeDistance(as, bs)))
215}

Callers

nothing calls this directly

Calls 7

DecodeStringFunction · 0.92
NewInt64Function · 0.92
IsNullMethod · 0.80
IsStringMethod · 0.80
WrapErrorMethod · 0.80
underAllFunction · 0.70
BytesMethod · 0.45

Tested by

no test coverage detected