code: func (model *Model) Autocomplete(input string) ([]string, error) {
  	model.RLock()
  	defer model.RUnlock()
  	if !model.UseAutocomplete {
  		return []string{}, errors.New("Autocomplete is disabled")
  	}
  	if len(input) == 0 {
  		return []string{}, errors.New("Input cannot have length zero")
  	}
  	express := "\x00" + input + "[^\x00]*"
  	match, err := regexp.Compile(express)
  	if err != nil {
  		return []string{}, err
  	}
  	matches := model.SuffixArr.FindAllIndex(match, -1)
  	a := &Autos{Results: make([]string, 0, len(matches)), Model: model}
  	for _, m := range matches {
  		str := strings.Trim(model.SuffixArrConcat[m[0]:m[1]], "\x00")
  		if count, ok := model.Data[str]; ok {
  			if count.Corpus > model.Threshold || count.Query > 0 {
  				a.Results = append(a.Results, str)
  			}
  		}
  	}
  	sort.Sort(a)
  	if len(a.Results) >= 10 {
  		return a.Results[:10], nil
  	}
  	return a.Results, nil
  }
docs: // For a given string, autocomplete using the suffix array model