type SymbolMatcher … const segmentStart … const wordStart … const separator … const upper … // NewSymbolMatcher creates a SymbolMatcher that may be used to match the given // search pattern. // // Currently this matcher only accepts case-insensitive fuzzy patterns. // // An empty pattern matches no input. func NewSymbolMatcher(pattern string) *SymbolMatcher { … } // Match searches for the right-most match of the search pattern within the // symbol represented by concatenating the given chunks. // // If a match is found, the first result holds the absolute byte offset within // all chunks for the start of the symbol. In other words, the index of the // match within strings.Join(chunks, ""). // // The second return value will be the score of the match, which is always // between 0 and 1, inclusive. A score of 0 indicates no match. // // If no match is found, Match returns (-1, 0). func (m *SymbolMatcher) Match(chunks []string) (int, float64) { … }