code: func (ngram *NGramIndex) BestMatch(input string, threshold ...float64) (*SearchResult, error) {
  	if ngram.index == nil {
  		ngram.init()
  	}
  	tval, error := validateThresholdValues(threshold)
  	if error != nil {
  		return nil, error
  	}
  	variants, error := ngram.match(input, tval)
  	if error != nil {
  		return nil, error
  	}
  	if len(variants) == 0 {
  		return nil, errors.New("no matches found")
  	}
  	var result SearchResult
  	maxsim := -1.0
  	for _, val := range variants {
  		if val.Similarity > maxsim {
  			maxsim = val.Similarity
  			result = val
  		}
  	}
  	return &result, nil
  }
docs: // BestMatch is the same as Search except that it's returning only one best result instead of all.