|
|
|
|
@ -248,14 +248,15 @@ class SearchViewModel: ObservableObject, Identifiable { |
|
|
|
|
.joined() |
|
|
|
|
.trimmed |
|
|
|
|
|
|
|
|
|
// Check for license numbers |
|
|
|
|
let matches = canonicalVersionWithoutPunctuation.licencesFound() |
|
|
|
|
let licensesPredicates = matches.map { NSPredicate(format: "license contains[cd] %@", $0) } |
|
|
|
|
predicates.append(NSCompoundPredicate(orPredicateWithSubpredicates: licensesPredicates)) |
|
|
|
|
|
|
|
|
|
if canonicalVersionWithoutPunctuation.isEmpty == false { |
|
|
|
|
let wordsPredicates = wordsPredicates() |
|
|
|
|
if let wordsPredicates { |
|
|
|
|
predicates.append(wordsPredicates) |
|
|
|
|
} else { |
|
|
|
|
predicates.append( |
|
|
|
|
NSPredicate( |
|
|
|
|
format: "license contains[cd] %@", canonicalVersionWithoutPunctuation)) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// Add match for full name |
|
|
|
|
|