Skip to content

Commit

Permalink
delete print
Browse files Browse the repository at this point in the history
  • Loading branch information
sugarkwork committed May 20, 2024
1 parent 766b4a7 commit e565dc9
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions nodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -126,15 +126,13 @@ def tag(self, tags:str, replace_tags:str="", match:float=0.3):
result = []
for i, tag in enumerate(tags_normalized):
tag_categories = self._get_categories(tag)
print(tag, tag_categories)
best_match_tag = None
best_match_tag_id = None
best_match_percentage = 0

for k, replace_tag in enumerate(replace_tags_normalized):
replace_categories = self._get_categories(replace_tag)
match_percentage = self._category_match_percentage(tag_categories, replace_categories)
print(replace_tag, replace_categories, match_percentage)

if match_percentage and match_percentage > best_match_percentage:
best_match_percentage = match_percentage
Expand All @@ -144,10 +142,8 @@ def tag(self, tags:str, replace_tags:str="", match:float=0.3):


if best_match_tag and best_match_percentage >= match:
print("@@@ best_match_tag", best_match_tag, best_match_percentage)
result.append(replace_tags[best_match_tag_id])
else:
print("### not best_match_tag", tags[i])
result.append(tags[i])

# replace_tags の中から、tags に存在しないタグを追加
Expand Down

0 comments on commit e565dc9

Please sign in to comment.