MCPcopy Create free account
hub / github.com/idank/explainshell / mapping_score

Method mapping_score

explainshell/store.py:443–448  ·  view source on GitHub ↗

Return the score of the mapping from *src* to *dst*, or None.

(self, src: str, dst: str)

Source from the content-addressed store, hash-verified

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."""
445 row = self._conn.execute(
446 "SELECT score FROM mappings WHERE src = ? AND dst = ? LIMIT 1", (src, dst)
447 ).fetchone()
448 return row["score"] if row else None
449
450 def update_mapping_score(self, src: str, dst: str, score: int) -> None:
451 """Update the score of an existing mapping."""

Calls

no outgoing calls