I have a string that I want to compare against an array of strings, and return the array element that most closely matches.
I can write a sliding correlator that counts the number of matching characters at each step and returns the max correlation. But is there a better way?
For example:
control_string = drv_probability_1_max
List:
burst_period_min/max
duty_cycle_min/max
probablility_0_min/max
probablility_1_min/max
Where ideally it returns "probablility_1_min/max"