Functions which perform heuristics for score functions.
See also
The HeuristicScore class.
Functions
|
Return candidates formatted by fstring. |
|
Force lower-case in value and candidates. |
|
Try to make value look like the name of a database table. |
|
Short circuit candidates which match a given regex to a given to-candidate. |
|
Short circuit candidates which match a given regex a given to-value. |
|
Return a value formatted by fstring. |
Try to make value look like the name of a database table.
Short circuit candidates which match a given regex a given to-value.
value – A value to map.
candidates – Candidates for value.
context – Context in which the function is being called.
regex – A pattern in candidates which should trigger forced short-circuit matching.
target – The target value. If value != to_value, an empty set is always returned.
Candidates which match regex, or an empty set.
Notes
This is technically a filter function and may be used as such.
Short circuit candidates which match a given regex to a given to-candidate.
value – A value to map.
candidates – Candidates for value.
context – Context in which the function is being called.
regex – A pattern in candidates which should trigger forced short-circuit matching.
target – A target candidate. Must be present in candidates, or empty set is always returned.
Candidates which match regex, or an empty set.
Notes
This is technically a filter function and may be used as such.
Force lower-case in value and candidates.
Return a value formatted by fstring.
value – Passed to fstring.format using the value placeholder key.
candidates – Not used (returned as given).
context – Context in which the function is being called.
fstring – The format string to use.
**kwargs – Additional keyword placeholders in fstring.
A tuple (formatted_value, candidates).
Return candidates formatted by fstring.
value – Not used (returned as given).
candidates – Passed to fstring.format using the candidates placeholder key.
context – Context in which the function is being called.
fstring – The format string to use.
**kwargs – Additional keyword placeholders in fstring.
A tuple (value, formatted_candidates).