I am basically looking at a construct to allow me to map multiple strings to the same value. So something like
Ford/Chrysler/Nissan ==> Cars
Raspberry/Blackberry/Blueberry ==> Berry
Apple/Mango/Bananas ==> Fruit
So I should arrive at the basetype by giving the specific word. What would be the best data structure for such a combination? Since it is not a good practice to search for keys when you know a value. This means a dict
is out of question.
Perhaps a hash function where all the above similar
ones all map to the same base type
if you know what I mean?