Out of curiosity, what does categorize(true) do? I searched through the DFHack documentation and could find anything about a function with that name.
It's not part of DFHack, but a virtual method within Dwarf Fortress itself.
If you look at
df.global.world.items, you will see a list named "all" and a whole bunch of lists inside "other". What
categorize() does is insert references to the item into all of the "other" lists according to the item's properties (and the "true" parameter in particular adds it to the "IN_PLAY" list at the top).
These "other" lists are used primarily for finding job items more quickly - instead of a hungry dwarf having to check every single item in your fortress (including all of the rocks in your mining tunnels), it just needs to look in the "ANY_EDIBLE_RAW" list to find something to eat. In case you're curious, Buildings are "categorized" in the exact same way.
For what it's worth, I just checked the "find food" code (which uses splitStack) in an older DF version and it does immediately call
categorize(true) on the newly-split item. Of course, it's also possible the version I'm looking at is too old (which is certainly possible since the version I checked was v0.23.130.23a) and that the current version needs to do more stuff afterwards, but it'll take me a while to find the relevant code in 0.47.05.