(keywords: list[str])
| 62 | print(" ☝️🥳 algorithm advisor 🥳☝️\n") |
| 63 | |
| 64 | def advisor(keywords: list[str]): |
| 65 | |
| 66 | # non-regex advisements |
| 67 | previous = False |
| 68 | for old, new in advisements.items(): |
| 69 | if utils.is_subseq_of(keywords, old): |
| 70 | print_advisement(old, new, previous) |
| 71 | previous = True |
| 72 | |
| 73 | # regex advisements |
| 74 | for pattern, replacement in regex_advisements.items(): |
| 75 | match = re.search(pattern, keywords) |
| 76 | if match: |
| 77 | matched = match.group() |
| 78 | new = re.sub(pattern, replacement, matched) |
| 79 | print_advisement(matched, new) |
nothing calls this directly
no test coverage detected