Archive > BeBot 0.5 support
Symb/PB module arent working
Karsta:
Kbot [GROUP] [MSG] [Northern Star] Karstasbiatc: !symb int control eye
Warning: implode(): Invalid arguments passed in /home/karstas/kbot541/core/Professions.php on line 198
and symb module arent giving info what PB drops those symbs
and still got same PB problem as in
http://bebot.link/bebot-0-5-support/!pb-command/
Kbot [GROUP] [MSG] [Northern Star] Karstasbiatc: !pb oak
string(3) "Imk"
Kbot [GROUP] [MSG] [Northern Star] Kbot: [link]Remains of Imk[/link]
Kbot [GROUP] [MSG] [Northern Star] Karstasbiatc: !pb zoetic
string(3) "Bia"
Kbot [GROUP] [MSG] [Northern Star] Kbot: [link]Remains of Bia[/link]
Karsta
redmagician:
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.
Temar:
yer we need to add a search before the current that will check for names containing wat u put 1st, if more than 1 do 2nd search on those only, if none so 2nd search on all
which im going to do NOW
Temar:
The PB module Search is now Fixed in SVN
Temar:
the Symb Implode Error is now Fixed
Navigation
[0] Message Index
[#] Next page
Go to full version