3131
3232from scanoss .constants import (
3333 DEFAULT_HFH_DEPTH ,
34+ DEFAULT_HFH_MIN_ACCEPTED_SCORE ,
3435 DEFAULT_HFH_RANK_THRESHOLD ,
3536 DEFAULT_HFH_RECURSIVE_THRESHOLD ,
3637)
@@ -61,6 +62,7 @@ def __init__( # noqa: PLR0913
6162 rank_threshold : int = DEFAULT_HFH_RANK_THRESHOLD ,
6263 depth : int = DEFAULT_HFH_DEPTH ,
6364 recursive_threshold : float = DEFAULT_HFH_RECURSIVE_THRESHOLD ,
65+ min_accepted_score : float = DEFAULT_HFH_MIN_ACCEPTED_SCORE ,
6466 ):
6567 """
6668 Initialize the ScannerHFH.
@@ -73,6 +75,7 @@ def __init__( # noqa: PLR0913
7375 rank_threshold (int): Get results with rank below this threshold (default: 5).
7476 depth (int): How many levels to scan (default: 1).
7577 recursive_threshold (float): Minimum score threshold to consider a match (default: 0.25).
78+ min_accepted_score (float): Only show results with a score at or above this threshold (default: 0.15).
7679 """
7780 self .base = ScanossBase (
7881 debug = config .debug ,
@@ -103,6 +106,7 @@ def __init__( # noqa: PLR0913
103106 self .scan_results = None
104107 self .rank_threshold = rank_threshold
105108 self .recursive_threshold = recursive_threshold
109+ self .min_accepted_score = min_accepted_score
106110
107111 def scan (self ) -> Optional [Dict ]:
108112 """
@@ -115,6 +119,7 @@ def scan(self) -> Optional[Dict]:
115119 'root' : self .folder_hasher .hash_directory (path = self .scan_dir ),
116120 'rank_threshold' : self .rank_threshold ,
117121 'recursive_threshold' : self .recursive_threshold ,
122+ 'min_accepted_score' : self .min_accepted_score ,
118123 }
119124
120125 spinner = Spinner ('Scanning folder...' )
0 commit comments