(item)
| 376 | pat = re.compile("(%s)" % regex) |
| 377 | |
| 378 | def _match(item): |
| 379 | if item.lower()[: len(text) + 1] in (text, text + " "): |
| 380 | # Exact match of first word in suggestion |
| 381 | # This is to get exact alias matches to the top |
| 382 | # E.g. for input `e`, 'Entries E' should be on top |
| 383 | # (before e.g. `EndUsers EU`) |
| 384 | return float("Infinity"), -1 |
| 385 | r = pat.search(self.unescape_name(item.lower())) |
| 386 | if r: |
| 387 | return -len(r.group()), -r.start() |
| 388 | |
| 389 | else: |
| 390 | match_end_limit = len(text) |
nothing calls this directly
no test coverage detected