Skip to content

Commit

Permalink
Fix bug: confidence should not exceed 1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
greyblake committed Aug 6, 2017
1 parent 7329590 commit 1d6c5d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/detect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ fn detect_lang_in_profiles(text: &str, options: &Options, lang_profile_list : La
// Number 500.0 is based on experiments and common sense expectations.
let mut confidence = (score1 as f64) / 500.0;
if confidence > 1.0 {
confidence == 1.0;
confidence = 1.0;
}
return Some((lang_dist1.0, confidence));
}
Expand Down

0 comments on commit 1d6c5d5

Please sign in to comment.