mirror of
https://github.com/neon443/StickerSlack.git
synced 2026-11-30 12:44:51 +00:00
new seach algorithm in search, might remove trie :br:
remove searcterm from hoarder move emojipackmanager
This commit is contained in:
8 files changed
+52
-41
No files matched your search
@@ -41,6 +41,14 @@ class Trie: ObservableObject {
|
||||
}
|
||||
}
|
||||
|
||||
func search(for query: String) -> [String] {
|
||||
var result: [String] = wordlist
|
||||
for word in query.split(separator: " ") {
|
||||
result = result.filter { $0.localizedCaseInsensitiveContains(word) }
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
func search(exactly query: String) -> Bool {
|
||||
var currentNode = root
|
||||
|
||||
|
||||