abstract confidence threshold

This commit is contained in:
Ben Balter 2018-08-25 11:49:49 -04:00
parent 58f540a901
commit f7ed24f8a8
No known key found for this signature in database
GPG Key ID: DBB67C246AD356C4
1 changed files with 7 additions and 1 deletions

View File

@ -43,7 +43,7 @@ module Licensee
def matches
@matches ||= matches_by_similarity.select do |_, similarity|
similarity >= Licensee.confidence_threshold
similarity >= minimum_confidence
end
end
@ -51,6 +51,12 @@ module Licensee
def confidence
@confidence ||= match ? file.similarity(match) : 0
end
private
def minimum_confidence
Licensee.confidence_threshold
end
end
end
end