Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Expanding search terms beyond #1473

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions src/tauon/t_modules/t_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -34704,6 +34704,22 @@ def worker2():

o_text = search_over.search_text.text.lower().replace("-", "")

# Now users can add more special search terms to these.
n2_pairs = [
(" and", [" &"]), (" &", [" and"]),
(" to", [" 2"]), (" 2", [" to"]),
(" two", [" 2"]), (" 2", [" two"]),
]

n2_mode = False
if any(n2 in o_text for n2, _ in n2_pairs):
n2_mode = True
c = o_text.lower()
for n2, words in n2_pairs:
for word in words:
c = c.replace(word, n2)
o_text = c.lower()

dia_mode = False
if all([ord(c) < 128 for c in o_text]):
dia_mode = True
Expand Down Expand Up @@ -34750,6 +34766,12 @@ def worker2():
continue
searched.add(track)

if n2_mode:
s_text = o_text
cache_string = search_string_cache.get(track)
if cache_string is not None:
if not search_magic_any(s_text, cache_string):
continue

if cn_mode:
s_text = o_text
Expand All @@ -34769,6 +34791,7 @@ def worker2():
continue
# if s_text not in cache_string:
# continue

else:
cache_string = search_string_cache.get(track)
if cache_string is not None:
Expand Down
Loading