Pair2 v0.1.1 Pair2.Matcher View Source
Rules-based matcher for finding optimal 1:1 matches between two lists of maps.
Link to this section Summary
Functions
Add a right match to the list associated with the left map. Structure: { left1: [{right1, score1}, {right2, score2}, …], left2… }
For a given left map, find the highest-scoring right map that is available for matching. If a previously-existing matched pair has a lower score, replace it and add that previous left map back to the unresolved list
Performs 1:1 match of two lists of maps, list_l and list_r, by applying rules from a list of rule structs. For two maps to match, their match score must be >= min_score
Resolves conflicts between left and right sides. Conflicts occur when a single right map is the highest-scoring match to more than one left map
Link to this section Functions
Add a right match to the list associated with the left map. Structure: { left1: [{right1, score1}, {right2, score2}, …], left2… }
For a given left map, find the highest-scoring right map that is available for matching. If a previously-existing matched pair has a lower score, replace it and add that previous left map back to the unresolved list.
Performs 1:1 match of two lists of maps, list_l and list_r, by applying rules from a list of rule structs. For two maps to match, their match score must be >= min_score.
Resolves conflicts between left and right sides. Conflicts occur when a single right map is the highest-scoring match to more than one left map.
Returns a list of finalized match tuples of form: {left, right, score}
For each left map: 1) Add all to an “unresolved” list. 2) For each left map in the unresolved list, choose the highest available match
if it hasn't already been assigned. If it has been assigned, award the match
to the pair with the highest score. Add the losing map back onto the unresolved list.
3) Continue until the unresolved list is empty.