Skip to content

Commit

Permalink
Apply passed in threshold to the stringclassifier as well as the high…
Browse files Browse the repository at this point in the history
…er-level

classifier.

PiperOrigin-RevId: 205124037
  • Loading branch information
crschmidt committed Oct 10, 2018
1 parent 3c8ad1f commit b11e09f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions classifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ type License struct {
// New creates a license classifier and pre-loads it with known open source licenses.
func New(threshold float64) (*License, error) {
classifier := &License{
c: stringclassifier.New(stringclassifier.DefaultConfidenceThreshold, Normalizers...),
c: stringclassifier.New(threshold, Normalizers...),
Threshold: threshold,
}
if err := classifier.registerLicenses(LicenseArchive); err != nil {
Expand All @@ -93,7 +93,7 @@ func New(threshold float64) (*License, error) {
// known open source licenses which are forbidden.
func NewWithForbiddenLicenses(threshold float64) (*License, error) {
classifier := &License{
c: stringclassifier.New(stringclassifier.DefaultConfidenceThreshold, Normalizers...),
c: stringclassifier.New(threshold, Normalizers...),
Threshold: threshold,
}
if err := classifier.registerLicenses(ForbiddenLicenseArchive); err != nil {
Expand Down

0 comments on commit b11e09f

Please sign in to comment.