(self, tokens: set[str], modules: tuple[PortingModule, ...], kind: str)
| 174 | return denials |
| 175 | |
| 176 | def _collect_matches(self, tokens: set[str], modules: tuple[PortingModule, ...], kind: str) -> list[RoutedMatch]: |
| 177 | matches: list[RoutedMatch] = [] |
| 178 | for module in modules: |
| 179 | score = self._score(tokens, module) |
| 180 | if score > 0: |
| 181 | matches.append(RoutedMatch(kind=kind, name=module.name, source_hint=module.source_hint, score=score)) |
| 182 | matches.sort(key=lambda item: (-item.score, item.name)) |
| 183 | return matches |
| 184 | |
| 185 | @staticmethod |
| 186 | def _score(tokens: set[str], module: PortingModule) -> int: |
no test coverage detected