I see the examples you provided (e.g. apple+weapon=appleweapon) but I don’t see a description of the logic involved. Are the result strings intended to be created by concatenating the input strings based on the order they appear in the list you provided at the outset?
You then provided an example of combining an input string with another resultstring (e.g. apple+weaponship=appleweaponship). In this case, are input strings intended to be checked for composition and given the order weight of the first substring in the composite string? Where, for weaponstring, the order weight would be that of weapon (i.e. 3), and therefore being concatenated after apple?
The logic, if you can lay it out, should help you to determine how to go about comparing strings.
And based on your description, it seems as though you might be able to concatenate an arbitrary number of strings which would result in an arbitrary number of result strings. This would mean you couldn’t create a case statement for every possible outcome.
Hashing might work but you would still want to guarantee consistency in key creation and would also need to find out the upper bounds of your possible concatenations.
All of this is going to go into figuring out how to approach the problem.