|
|
|
@ -156,8 +156,8 @@ class SearchViewModel: ObservableObject, Identifiable { |
|
|
|
func orPredicate() -> NSPredicate? { |
|
|
|
func orPredicate() -> NSPredicate? { |
|
|
|
var predicates : [NSPredicate] = [] |
|
|
|
var predicates : [NSPredicate] = [] |
|
|
|
let allowedCharacterSet = CharacterSet.alphanumerics.union(.whitespaces) |
|
|
|
let allowedCharacterSet = CharacterSet.alphanumerics.union(.whitespaces) |
|
|
|
let canonicalVersionWithoutPunctuation = searchText.canonicalVersion.components(separatedBy: allowedCharacterSet.inverted).joined() |
|
|
|
let canonicalVersionWithoutPunctuation = searchText.canonicalVersion.components(separatedBy: allowedCharacterSet.inverted).joined().trimmed |
|
|
|
let canonicalVersionWithPunctuation = searchText.canonicalVersionWithPunctuation |
|
|
|
let canonicalVersionWithPunctuation = searchText.canonicalVersionWithPunctuation.trimmed |
|
|
|
switch tokens.first { |
|
|
|
switch tokens.first { |
|
|
|
case .none: |
|
|
|
case .none: |
|
|
|
if canonicalVersionWithoutPunctuation.isEmpty == false { |
|
|
|
if canonicalVersionWithoutPunctuation.isEmpty == false { |
|
|
|
|