MCPcopy Create free account
hub / github.com/GopherML/bag / String

Method String

characterngram.go:39–51  ·  view source on GitHub ↗

String will convert the characterNGram contents to a string

()

Source from the content-addressed store, hash-verified

37
38// String will convert the characterNGram contents to a string
39func (n characterNGram) String() (out string) {
40 // Initialize buffer
41 buf := bytes.NewBuffer(nil)
42 // Iterate through characterNGram values
43 n.ForEach(func(char rune) (end bool) {
44 // Write value to buffer
45 buf.WriteRune(char)
46 return
47 })
48
49 // Return buffer as string
50 return buf.String()
51}
52
53// IsZero returns whether or not the characterNGram is empty
54func (n characterNGram) IsZero() bool {

Callers 1

toCharacterNGramsFunction · 0.95

Calls 1

ForEachMethod · 0.80

Tested by

no test coverage detected