Feature Fuzzy Matcher should accept plural names when searching for more than one of an item

DeNarr

New member
So I went to buy my 3 limes today in order to eat, and I got a very nasty surprise.

> buy 3 limes

Searching for "linoleum meat stack"...
Search complete.
Purchasing linoleum meat stack (1 @ 42,000)...
You acquire an item: linoleum meat stack
Purchasing linoleum meat stack (2 @ 45,000)...
You acquire linoleum meat stack (2)
Purchases complete.

I'm on version 9322. This is repeatable by searching for "limes" in the purchase section. Kind of sucks when I want to spend 3000 on food and accidentally spend over 130k on some stupid meat stacks.
 
Last edited:

xKiv

Active member
There's no "limes" item. You don't enter plural forms in mafia commands. What you want is
> buy 3 lime
 

lostcalpolydude

Developer
Staff member
Since the item name is "lime" and not "limes", I'm guessing that you want mafia to check plurals of item names before checking for multi-word matches? Fuzzy matching can still cause problems with other misspellings of item names, and limiting the fuzzy matching to remove cases like this probably removes some functionality that people use.
 

Veracity

Developer
Staff member
You meant to search for "lime" (which is the name of the item you wanted to buy) but the extra "s" made KoLmafia's fuzzy matching kick in. It found linoleum meat stack. That is precisely the kind of matching that makes "mmj" successfully find magical mystery juice.

I'm not sure whether to mark this as "not a bug", since the search behaved correctly, or change it to a "feature request" to make fuzzy matching look for known plurals first.
 

roippi

Developer
Not entirely related, but you might want to drop your autobuy limit down to limit this sort of thing from happening as well.

As for the feature request... it might make things a little easier syntactically for new users, but this seems like a one-off case where there was unfortunately a fuzzy match for a short plural. Most of the time it will return no matches and the user will quickly figure out not to pluralize. Seems really low priority.
 

DeNarr

New member
At the bare least, I don't think that it should have made such a jump in logic as to assume limes meant linoleum meat stack. Now, if I searched for "li me s", then I could see it returning that, but without the spaces I don't understand how it would find linoleum meat stack instead of lime.

P.S. Where do you find this autobuy limit you mentioned roippi?
 
Last edited:

lostcalpolydude

Developer
Staff member
I don't think autoBuyPriceLimit is checked if you "buy" something based on the isAutomated check in the code for the one function where autoBuyPriceLimit is checked.
 

DeNarr

New member
That's correct. I did a quick check.

> set autoBuyPriceLimit = 1000

autoBuyPriceLimit => 1000

> buy boilerm

Searching for "boilermaker"...
Search complete.
Purchasing boilermaker (1 @ 1,680)...
You acquire an item: boilermaker
Purchases complete.
 

Veracity

Developer
Staff member
At the bare least, I don't think that it should have made such a jump in logic as to assume limes meant linoleum meat stack. Now, if I searched for "li me s", then I could see it returning that, but without the spaces I don't understand how it would find linoleum meat stack instead of lime.
You didn't read or understand what I wrote did you? This was in no way a "jump in logic". It is specifically how the algorithm works to let "mmj" (no spaces) match "magical mystery juice".

You've convinced me: this is not a Bug. At best, this is a Feature Request to extend the fuzzy matcher to look at plurals - perhaps only if you give a number, as in "5 limes".
 

Theraze

Active member
Would the fuzzy matcher-plural also make plurals work for conditions? If you put 5 lines as your goal for the hole in the sky, it fails, because there isn't a "lines" item. I figured it out and ignore the grammar now, but for people new to mafia, matching plurals as a form of the item might be less confusing, especially if it works in all of these circumstances.
 

DeNarr

New member
I did read what you wrote, I just was stating that for multi word searches I found it strange that it wouldn't require a space. I can understand how some people would want to write "buy mmj" rather than "buy m m j", I just had no idea that it would be set up to do that. To me it would make sense to need the space. I also understand that the plural is what messed it up, and it would be nice if it accepted the plural with multiple items being requested.

I guess really I just don't understand how the search does and doesn't interpret spaces.
"lime" finds the limes
"li me" finds stuffed limes and lime gum, but not the food
"limes" and li me s find linoleum meat stacks
"lime s" finds slime stack

And none of them find each other in the search bar.
 
I found it strange that it wouldn't require a space. I can understand how some people would want to write "buy mmj"
You seem to resolve your own curiosity here.

Anyway, I friggin -love- the spaceless fuzzy matching; it lets people make -insane- buff requests and still get the thing they want, like asking for "Pobarr" and getting Power Ballad.
 

fronobulax

Developer
Staff member
There is a special place in Valhalla reserved for people who insist that white space is always and unconditionally a delimiter. It's the place where the practice dummies, used by the true warriors, are kept.

Seriously, the more text processing someone does across multiple computing environments, the more likely they are to want the option to treat spaces and other 'white space" as non-special characters. So your expectation that spaces should be special is reasonable but unlikely to be supported.
 

Winterbay

Active member
I think that if one handles whitespace as a delimiter then one should be consistent about it. Unlike SAP (horrible useful system as it is) which sometimes treats whitespace as significant and sometimes doesn't. Extremely annoying...
 

DeNarr

New member
You seem to resolve your own curiosity here.

Anyway, I friggin -love- the spaceless fuzzy matching; it lets people make -insane- buff requests and still get the thing they want, like asking for "Pobarr" and getting Power Ballad.

Yes, now that I know it doesn't need space I've had some fun with it and agree it shouldn't need a space. It's just that when buying things with the fuzzy matching, it's possible to get bitten pretty hard like I did, and I was trying to prevent anyone else form making the same mistake. My mind was working with proper grammar rather than proper code, and so I bought 3 limes rather than 3 lime. For whatever reason linoleum meat stacks are ridiculously expensive, and I wasted a bunch of meat because of it.
 
Last edited:
Top