Skip to content

Commit

Permalink
tokenize strings
Browse files Browse the repository at this point in the history
  • Loading branch information
ooprathamm committed Mar 10, 2024
1 parent 8724444 commit ed5abea
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion floss/qs/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,15 @@ def render_string_line(console: Console, tag_rules: TagRules, string: TaggedStri
console.print(line)

if search_string:
layout.strings = [string for string in layout.strings if fuzz.ratio(string.string.string, search_string) >= 50]
layout.strings = [
string
for string in layout.strings
if any(
fuzz.ratio(token, search_token) >= 50
for token in string.string.string.split(' ')
for search_token in search_string.split(' ')
)
]

if not layout.children:
# for string in layout.strings[:4]:
Expand Down

0 comments on commit ed5abea

Please sign in to comment.