Well I found the problem but I'm not quite sure how to fix it.
The function best_match uses a function called levenshtein() that computes the number of characters that need to be replaced, added, or deleted for the search string to match one of the pocket boss names.
levenshtein() is currently set up to use equal weights for replacing, adding, or removing characters. The reason you're seeing "Imk" when you search for "oak" is because the cost to replace "o" and "a" is less than the cost of adding "Zoetic".
The weights can be changed so one operation is favored over another but the result isn't always what's expected.
For example, if you replace
levenshtein($search, $straw[0])
with
levenshtein($search, $straw[0], 1, 20, 30)
Then insertions (1) are strongly favored over replacing (20) and deletion (30).
I have a hard time predicting the output of the levenshtein function so I am not willing to spend a great amount of time making the function work in a predictable manner.
I'll check back when I have some time and look into replacing the function with something I consider to be more predictable if someone else hasn't fixed the issue.