mirror of
https://github.com/go-task/task.git
synced 2025-11-25 22:32:55 +02:00
fix: disable fuzzy
This commit is contained in:
31
setup.go
31
setup.go
@@ -103,24 +103,25 @@ func (e *Executor) readTaskfile(node taskfile.Node) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (e *Executor) setupFuzzyModel() {
|
func (e *Executor) setupFuzzyModel() {
|
||||||
|
|
||||||
if e.Taskfile == nil {
|
if e.Taskfile == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
//
|
||||||
model := fuzzy.NewModel()
|
//model := fuzzy.NewModel()
|
||||||
model.SetThreshold(1) // because we want to build grammar based on every task name
|
//model.SetThreshold(1) // because we want to build grammar based on every task name
|
||||||
|
//
|
||||||
var words []string
|
//var words []string
|
||||||
for name, task := range e.Taskfile.Tasks.All(nil) {
|
//for name, task := range e.Taskfile.Tasks.All(nil) {
|
||||||
if task.Internal {
|
// if task.Internal {
|
||||||
continue
|
// continue
|
||||||
}
|
// }
|
||||||
words = append(words, name)
|
// words = append(words, name)
|
||||||
words = slices.Concat(words, task.Aliases)
|
// words = slices.Concat(words, task.Aliases)
|
||||||
}
|
//}
|
||||||
|
//
|
||||||
model.Train(words)
|
//model.Train(words)
|
||||||
e.fuzzyModel = model
|
//e.fuzzyModel = model
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *Executor) setupTempDir() error {
|
func (e *Executor) setupTempDir() error {
|
||||||
|
|||||||
Reference in New Issue
Block a user