(tokens: set[str], module: PortingModule)
| 184 | |
| 185 | @staticmethod |
| 186 | def _score(tokens: set[str], module: PortingModule) -> int: |
| 187 | haystacks = [module.name.lower(), module.source_hint.lower(), module.responsibility.lower()] |
| 188 | score = 0 |
| 189 | for token in tokens: |
| 190 | if any(token in haystack for haystack in haystacks): |
| 191 | score += 1 |
| 192 | return score |