|
@@ -1,6 +1,7 @@
|
|
|
package fuzzy
|
|
|
|
|
|
import (
|
|
|
+ "fmt"
|
|
|
"strings"
|
|
|
)
|
|
|
|
|
@@ -63,9 +64,11 @@ func buildFuzzyChunks(fuzzyInput string, caseSensitive bool) ([]string, []string
|
|
|
preciseExclude := false //Exclude precise word from buffer
|
|
|
preciseBuffer := []string{}
|
|
|
|
|
|
+ fmt.Println(fuzzyInput)
|
|
|
if !caseSensitive {
|
|
|
fuzzyInput = strings.ToLower(fuzzyInput)
|
|
|
}
|
|
|
+ fmt.Println(fuzzyInput)
|
|
|
|
|
|
fuzzyChunks := strings.Split(fuzzyInput, " ")
|
|
|
for _, thisChunk := range fuzzyChunks {
|
|
@@ -75,8 +78,15 @@ func buildFuzzyChunks(fuzzyInput string, caseSensitive bool) ([]string, []string
|
|
|
includeList = append(includeList, thisChunk[1:len(thisChunk)-1])
|
|
|
} else if len(thisChunk) > 1 && thisChunk[:1] == "-" && thisChunk[1:2] == "\"" {
|
|
|
// Example: -"asd
|
|
|
- preciseExclude = true
|
|
|
- preciseBuffer = append(preciseBuffer, thisChunk[2:])
|
|
|
+
|
|
|
+ if thisChunk[len(thisChunk)-1:] == "\"" {
|
|
|
+ //-"asd", push directly into exclude list
|
|
|
+ excludeList = append(excludeList, thisChunk[2:len(thisChunk)-1])
|
|
|
+ } else {
|
|
|
+ preciseExclude = true
|
|
|
+ preciseBuffer = append(preciseBuffer, thisChunk[2:])
|
|
|
+ }
|
|
|
+
|
|
|
} else if len(thisChunk) > 0 && thisChunk[:1] == "\"" {
|
|
|
//Starting of precise string
|
|
|
//Example (start of): "asd asd"
|