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

Expand search terms #1484

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
24 changes: 24 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,17 @@ def worker2():

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

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

n2_mode = False
if any(n2 in o_text for n2, _ in n2_pairs):
n2_mode = True

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

if n2_mode:
c = o_text.lower()
for n2, word in n2_pairs:
if not word in o_text:
c = c.replace(n2, word)
o_text = c.lower()

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 +34792,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