(item)
| 364 | pat = re.compile('(%s)' % regex) |
| 365 | |
| 366 | def _match(item): |
| 367 | match_item = None |
| 368 | if item.lower()[:len(text) + 1] in (text, text + ' '): |
| 369 | # Exact match of first word in suggestion |
| 370 | # This is to get exact alias matches to the top |
| 371 | # E.g. for input `e`, 'Entries E' should be on top |
| 372 | # (before e.g. `EndUsers EU`) |
| 373 | match_item = float('Infinity'), -1 |
| 374 | r = pat.search(self.unescape_name(item.lower())) |
| 375 | if r: |
| 376 | match_item = -len(r.group()), -r.start() |
| 377 | return match_item |
| 378 | else: |
| 379 | match_end_limit = len(text) |
| 380 |
nothing calls this directly
no test coverage detected