Exporting¶
Mapping¶
- class qbindiff.mapping.Mapping(mapping: Iterable[tuple[Any, Any, float, int]], unmatched_primary: set[Any], unmatched_secondary: set[Any])[source]¶
Bases:
object
This class represents an interface to access the result of the matching analysis. Its interface is independent of the underlying objects / items manipulated.
- add_match(item1: Any, item2: Any, similarity: float | None = None, confidence: float = 0.0, squares: int | None = None) None [source]¶
Add the given match between the two items.
- Parameters:
item1 – function address in primary
item2 – function address in secondary
similarity – similarity metric as float
confidence – confidence in the result (0..1)
squares – Number of squares being made
- Returns:
None
- is_match_primary(item: Any) bool [source]¶
Returns true if the items in primary did match with an item in secondary.
- Parameters:
item – item to match in primary
- Returns:
whether the item is matched in primary
- is_match_secondary(item: Any) bool [source]¶
Returns true if the item in secondary did match with an item in primary.
- Parameters:
item – item to match in secondary
- Returns:
whether the item is matched in secondary
- match_primary(item: Any) Match | None [source]¶
Returns the match associated with the given primary item (if any).
- Parameters:
item – item to match in primary
- Returns:
optional match
- match_secondary(item: Any) Match | None [source]¶
Returns the match associated with the given secondary item (if any).
- Parameters:
item – item to match in secondary
- Returns:
optional match