@@ -62,8 +62,8 @@ def add_search(p):
62
62
c .add_argument (
63
63
"-m" ,
64
64
"--match-score" ,
65
- default = "75 " ,
66
- help = "(Optional) A score between 0 and 100 to use to filter the results by. (Default = 75 ). The lower the number the more results will be output" ,
65
+ default = "90 " ,
66
+ help = "(Optional) A score between 0 and 100 to use to filter the results by. (Default = 90 ). The lower the number the more results will be output" ,
67
67
)
68
68
c .add_argument (
69
69
"-c" ,
@@ -156,6 +156,7 @@ def search_packages(json_dict, search_terms, search_type="both", score_cutoff=50
156
156
++++++++
157
157
1) (dict) A list of pkg names who's either name or keyword match score reached the score cutoff
158
158
"""
159
+ import re
159
160
from collections import defaultdict
160
161
161
162
from fuzzywuzzy import fuzz , process
@@ -186,7 +187,12 @@ def search_packages(json_dict, search_terms, search_type="both", score_cutoff=50
186
187
keyword_max_score = max (
187
188
[
188
189
fuzz .ratio (term .lower (), x .lower ())
189
- for x in json_dict ["packages" ][pkg ]["keywords" ]
190
+ for x in [
191
+ subkeyword
192
+ for keyword in json_dict ["packages" ][pkg ]["keywords" ]
193
+ for subkeyword in re .split ("-|_" , keyword .strip ())
194
+ ]
195
+ + json_dict ["packages" ][pkg ]["keywords" ]
190
196
]
191
197
)
192
198
@@ -463,8 +469,16 @@ def print_summary(search_terms, json_dict, match_list, installed_pkgs, installed
463
469
else :
464
470
from .utils import check_for_meta_recipes
465
471
466
- results .append ("\n \t To install run:\n \t \t ggd install %s %s" % (pkg , "--id <meta-recipe ID>" if check_for_meta_recipes (pkg ,json_dict ) else "" ))
467
-
472
+ results .append (
473
+ "\n \t To install run:\n \t \t ggd install %s %s"
474
+ % (
475
+ pkg ,
476
+ "--id <meta-recipe ID>"
477
+ if check_for_meta_recipes (pkg , json_dict )
478
+ else "" ,
479
+ )
480
+ )
481
+
468
482
print ("\n \n " .join (results ))
469
483
print ("\n " , dash )
470
484
0 commit comments