MCPcopy Index your code
hub / github.com/go-task/task / setupFuzzyModel

Method setupFuzzyModel

setup.go:110–129  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

108}
109
110func (e *Executor) setupFuzzyModel() {
111 if e.Taskfile == nil {
112 return
113 }
114
115 model := fuzzy.NewModel()
116 model.SetThreshold(1) // because we want to build grammar based on every task name
117
118 var words []string
119 for name, task := range e.Taskfile.Tasks.All(nil) {
120 if task.Internal {
121 continue
122 }
123 words = append(words, name)
124 words = slices.Concat(words, task.Aliases)
125 }
126
127 model.Train(words)
128 e.fuzzyModel = model
129}
130
131func (e *Executor) setupTempDir() error {
132 if e.TempDir != (TempDir{}) {

Callers

nothing calls this directly

Calls 1

AllMethod · 0.45

Tested by

no test coverage detected