It sounds like your categories are more granular than the ones used by the merchant, which means you can't simply pour all the "gadgets" into the "mp3 player" bin. But there may be some categories that map directly to yours, so find those and create a rule: if (category is 'portable music devices'){
mycategory = 'mp3 players'
}
or perhaps you may need tables full of these rules
if (category in array('portable music devices','mp3','music players','ipods',...)){
mycategory = 'mp3 players'
}
If there is no obvious category mapping, then your job gets tougher. You've got an item, presumably with a title - like "ipod nano" - and you need to categorize it yourself.
I'd be inclined to write a script that checks an item's similarity to other items that already exist, based on the item's name and words in the description, then figure out the most likely category by looking at its nearest neighbours.
the technique is called "data clustering" and it's not for the faint of heart
[en.wikipedia.org...]
Another alternative is to do it manually, which may be easier (depends how many items we're talking about)