Skip to content

Commit

Permalink
Add exhaustive search
Browse files Browse the repository at this point in the history
  • Loading branch information
shamazmazum committed Aug 31, 2023
1 parent 81cb25a commit c5840ce
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions cli/cli.lisp
Expand Up @@ -52,6 +52,10 @@ mean lower sensibility. Good values to try are (40-60)."
(intern
(string-upcase hash)
(find-package :keyword))))
(:name :exhaustive
:description "Run exhaustive search (slow)"
:short #\e
:long "exhaustive")
(:name :remove-errored
:description "Remove images which cannot be read (dangerous!)"
:long "remove-errored")
Expand All @@ -77,8 +81,8 @@ mean lower sensibility. Good values to try are (40-60)."
(log:config
(if (getf options :quiet)
:warn :info))
(let* ((big-set (getf options :big-set))
(set (first arguments))
(let* ((big-set (getf options :big-set))
(exhaustive (getf options :exhaustive nil))
(key-args (list :threshold (getf options :threshold *threshold*)
:recursive (getf options :recursive nil)
:remove-errored (getf options :remove-errored nil)
Expand All @@ -88,9 +92,15 @@ mean lower sensibility. Good values to try are (40-60)."
:image-types (set-difference *image-types*
(getf options :ignore-types)
:test #'string=)))
(similar (if big-set
(apply #'similar-subset set big-set key-args)
(apply #'find-similar-prob set key-args))))
(set (first arguments))
(similar
(cond
(big-set
(apply #'similar-subset set big-set key-args))
(exhaustive
(apply #'find-similar set key-args))
(t
(apply #'find-similar-prob set key-args)))))

(case (getf options :mode :view)
(:print
Expand Down

0 comments on commit c5840ce

Please sign in to comment.