Return whether a mapping from *src* to *dst* already exists.
(self, src: str, dst: str)
| 434 | self._conn.commit() |
| 435 | |
| 436 | def has_mapping(self, src: str, dst: str) -> bool: |
| 437 | """Return whether a mapping from *src* to *dst* already exists.""" |
| 438 | row = self._conn.execute( |
| 439 | "SELECT 1 FROM mappings WHERE src = ? AND dst = ? LIMIT 1", (src, dst) |
| 440 | ).fetchone() |
| 441 | return row is not None |
| 442 | |
| 443 | def mapping_score(self, src: str, dst: str) -> int | None: |
| 444 | """Return the score of the mapping from *src* to *dst*, or None.""" |
no outgoing calls