Recognizing plural items

StDoodle

Minion
Hey all;

Is there a way to parse a plural item into an $item simply and quickly, if it isn't already in the "You acquire..." format? As far as I can come up with, the only way to do so (if, say, one is parsing clan stash activity) is to extract the item string, then pass it to an array with extract_items() after prepending it with the acquisition text. This seems a bit roundabout simply to recognize one pluralized item, but I'm at a loss for a better solution. Any ideas would be greatly appreciated.

-std
 

heeheehee

Developer
Staff member
Yeah, I think my clan_log.ash built a map via
PHP:
foreach i in $items[] to_singular[i.to_plural()] = i;

You might want to check that out, since most of the framework's already there.
 

Theraze

Active member
From a quick check, to_item(item, count) should look up plurals....

Does... just make sure you ask for multiple.
ash to_item("asparagus knives", 1)

Returned: none
ash to_item("asparagus knives", 2)

Returned: asparagus knife
 
Last edited:

StDoodle

Minion
Bah, I had no idea there was an overloaded version of to_item() (which is kinda sad, since I'm pretty sure I've checked on its wiki page at least once). Thanks guys!
 
Top