func NewSuggester() (*Suggester, error) {
	resources, err := storage.GetAllResources()
	if err != nil {
		return nil, err
	}

	names := make([]string, 0, len(resources))
	for _, r := range resources {
		names = append(names, r.Name)
	}

	// Choose a set of bag sizes, more is more accurate but slower
	bagSizes := []int{3}

	// Create a closestmatch object
	cm := closestmatch.New(names, bagSizes)
	return &Suggester{matcher: cm}, nil
}
// NewSuggester builds a suggester based on your resources
NewSuggester builds a suggester based on your resources
// NewSuggester builds a suggester based on your resources
func NewSuggester() (*Suggester, error) {
	resources, err := storage.GetAllResources()
	if err != nil {
		return nil, err
	}
	names := make([]string, 0, len(resources))
	for _, r := range resources {
		names = append(names, r.Name)
	}
	bagSizes := []int{3}
	cm := closestmatch.New(names, bagSizes)
	return &Suggester{matcher: cm}, nil
}
func NewSuggester ( ) ( * Suggester , error ) { resources , err := storage . GetAllResources ( ) if err != nil { return nil , err } names := make ( [ ] string , 0 , len ( resources ) ) for _ , r := range resources { names = append ( names , r . Name ) } bagSizes := [ ] int { 3 } cm := closestmatch . New ( names , bagSizes ) return & Suggester { matcher : cm } , nil }
NewSuggester builds a suggester based on your resources
NewSuggester builds a suggester based on your resources
// Choose a set of bag sizes, more is more accurate but slower // Create a closestmatch object