String will convert the characterNGram contents to a string
()
| 37 | |
| 38 | // String will convert the characterNGram contents to a string |
| 39 | func (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 |
| 54 | func (n characterNGram) IsZero() bool { |
no test coverage detected