New to programming :/
inside a software I have a value associated to a key. There are sometimes different variations of that key used (e.g., lens left, left lens, Lens_L, etc.). I use a script to evaluate that value associated with that key but have been hard coding each possible variation.
Can I create a list (or dictionary, collection, etc.) that I can call on in the script so that any variation of that key will be recognized? Instead of manually typing each variation in each script?
I also wonder if I could create a list of variations of a key and then call on that list in a dictionary assigned to the key? If so...could I call on the dictionary simply in a script to accept all variations of the desired key?
Thanks in advance.
What I have tried:
I have tried creating a hashtable but am under the impression I can only assign one value to each key in the hashtable. This is what I started creating before I realized I could only have one value in each key...
using System;
using System.Collections;
class Example
{
public static void Main()
{
Hashtable structureSetBrain = new Hashtable();
structureSetBrain.Add('brain', 'Brain');
structureSetBrain.Add('BrainStem', 'brainstem', 'brain stem', 'Brain Stem', 'Brainstem');
structureSetBrain.Add('BrainStem+3mm', 'Brainstem+3mm', 'BS_3mm', 'BS_3', 'Brainstem_3', 'BrainStem_3', 'BrainStem_PRV', 'Brainstem_PRV', 'Brainstem PRV', 'BrainStem PRV')
structureSetBrain.Add('Cerebellum', 'cerebellum');
structureSetBrain.Add('Cerebrum', 'cerebrum');
structureSetBrain.Add('Chiasm', 'chiasm', 'optic chiasm', 'Optic Chiasm', 'OpticChiasm');
structureSetBrain.Add('CranialNerve', 'CN', 'Cranial Nerve', 'nerve_cranial', 'CranialNerves', 'cranial nerve');
structureSetBrain.Add('CN_VII', 'CranialNerve7', 'Seventh Cranial Nerve', 'SeventhCN');
structureSetBrain.Add('CN_VIII', 'CranialNerve8', 'Eighth Cranial Nerve', 'EighthCN');
structureSetBrain.Add('Cochlea', 'cochlea');
structureSetBrain.Add('Cochleas', 'cochleas');
structureSetBrain.Add('Cochlea_L', 'Left Cochlea', 'Cochlea LT', 'Cochlea_LT', 'Cochlea_Left', 'cochlea_L', 'cochlea_LT', 'left cochlea', 'cochlea lt', 'cochlea_lt', 'cochlea_left');
structureSetBrain.Add('Cochlea_R', 'Right Cochlea', 'Cochlea RT', 'Cochlea_RT', 'Cochlea_Right', 'cochlea_R', 'cochlea_RT', 'right cochlea', 'cochlea rt', 'cochlea_rt', 'cochlea_right');
structureSetBrain.Add('Cornea', 'cornea');
structureSetBrain.Add('Corneas', 'corneas');
structureSetBrain.Add('Cornea_L', 'Left Cornea', 'Cornea LT', 'Cornea_LT', 'Cornea_Left', 'cornea_L', 'cornea_LT', 'left cornea', 'cornea lt', 'cornea_lt', 'cornea_left');
structureSetBrain.Add('Cornea_R', 'Right Cornea', 'Cornea RT', 'Cornea_RT', 'Cornea_Right', 'cornea_R', 'cornea_RT', 'right cornea', 'cornea rt', 'cornea_rt', 'cornea_right');
structureSetBrain.Add('Eye', 'eye', 'Globe', 'globe');
structureSetBrain.Add('Eyes', 'eyes', 'Globes', 'globes');
structureSetBrain.Add('Eye_L', 'Left Eye', 'Eye LT', 'Eye_LT', 'Eye_Left', 'eye_L', 'eye_LT', 'left eye', 'eye lt', 'eye_lt', 'eye_left', 'Globe_L', 'Left Globe', 'Globe LT', 'Globe_LT', 'Globe_Left', 'globe_L', 'globe_LT', 'left globe', 'globe lt', 'globe_lt', 'globe_left');
structureSetBrain.Add('Eye_R', 'Right Eye', 'Eye RT', 'Eye_RT', 'Eye_Right', 'eye_R', 'eye_RT', 'right eye', 'eye rt', 'eye_rt', 'eye_right', 'Globe_R', 'Right Globe', 'Globe RT', 'Globe_RT', 'Globe_Right', 'globe_R', 'globe_RT', 'right globe', 'globe rt', 'globe_rt', 'globe_right');
structureSetBrain.Add('FrontalLobe', 'frontalLobe', 'frontallobe', 'frontal lobe', 'Frontal_Lobe', 'frontal_lobe');
structureSetBrain.Add('Hippocampus', 'hippocampus');
structureSetBrain.Add('Hypothalamus', 'hypothalamus');
structureSetBrain.Add('LacrimalGland', 'lacrimalgland', 'lacrimal gland');
structureSetBrain.Add('LacrimalGlands', 'lacrimalglands', 'lacrimal glands');
structureSetBrain.Add('Lacrimal_L', 'Left Lacrimal', 'Lacrimal LT', 'Lacrimal_LT', 'Lacrimal_Left', 'lacrimal_L', 'lacrimal_LT', 'left lacrimal', 'lacrimal lt', 'lacrimal_lt', 'lacrimal_left');
structureSetBrain.Add('Lacrimal_R', 'Right Lacrimal', 'Lacrimal RT', 'Lacrimal_RT', 'Lacrimal_Right', 'lacrimal_R', 'lacrimal_RT', 'right lacrimal', 'lacrimal rt', 'lacrimal_rt', 'lacrimal_right');
structureSetBrain.Add('Lens', 'lens');
structureSetBrain.Add('Lenses', 'lenses');
structureSetBrain.Add('Lens_L', 'Left Lens', 'Lens LT', 'Lens_LT', 'Lens_Left', 'lens_L', 'lens_LT', 'left lens', 'lens lt', 'lens_lt', 'lens_left');
structureSetBrain.Add('Lens_R', 'Right Lens', 'Lens RT', 'Lens_RT', 'Lens_Right', 'lens_R', 'lens_RT', 'right lens', 'lens rt', 'lens_rt', 'lens_right');
structureSetBrain.Add('OccipitalLobe', 'Occipital Lobe', 'occ lobe', 'occ_lobe', 'occipitalLobe', 'occLobe');
structureSetBrain.Add('OpticNerve', 'Optic Nerve', 'optic nerve', 'opticNerve', 'Optic nerve');
structureSetBrain.Add('OpticNerves', 'Optic Nerves', 'optic nerves', 'opticNerves', 'Optic nerves');
structureSetBrain.Add('OpticNerve_L', 'OpticNerve_LT', 'opticnerve_L', 'opticnerve_LT', 'ON_L', 'ON_LT', 'ON_lt', 'ON_Left', 'ON_left', 'on_L', 'on_LT', 'on_left', 'on_Left');
structureSetBrain.Add('OpticNerve_R', 'OpticNerve_RT', 'opticnerve_R', 'opticnerve_RT', 'ON_R', 'ON_RT', 'ON_rt', 'ON_Right', 'ON_right', 'on_R', 'on_RT', 'on_right', 'on_Right');
structureSetBrain.Add('ParietalLobe', 'Parietal Lobe', 'parietallobe', 'parietalLobe', 'parLobe');
structureSetBrain.Add('ParietLobe_L', 'ParLobe_L', 'ParietLobe_LT', 'ParLobe_LT', 'ParietLobe Lt', 'ParietLobe_Lt', 'ParietLobe_l', 'ParietLobe_lt, Parietal_L', 'Parietal_LT', 'Parietal_l', 'Parietal_lt', 'parlobe_L', 'parietlobe_LT', 'parlobe_LT', 'parietlobe_l', 'parietlobe_lt, parietal_L', 'parietal_LT', 'parietal_l', 'parietal_lt');
structureSetBrain.Add('ParietLobe_R', 'ParLobe_R', 'ParietLobe_RT', 'ParLobe_RT', 'ParietLobe Rt', 'ParietLobe_Rt', 'ParietLobe_r', 'ParietLobe_rt, Parietal_R', 'Parietal_RT', 'Parietal_r', 'Parietal_rt', 'parlobe_R', 'parietlobe_RT', 'parlobe_RT', 'parietlobe_r', 'parietlobe_rt, parietal_R', 'parietal_RT', 'parietal_r', 'parietal_rt');
structureSetBrain.Add('Pituitary', 'pituitary');
structureSetBrain.Add('Retina', 'retina');
structureSetBrain.Add('Retinae', 'Retinas', 'retinae', 'retinas');
structureSetBrain.Add('Retina_L', 'Left Retina', 'Retina LT', 'Retina_LT', 'Retina Lt', 'Retina_Lt', 'Retina_Left', 'retina_L', 'retina_LT', 'left retina', 'retina lt', 'retina_lt', 'retina_left');
structureSetBrain.Add('Retina_R', 'Right Retina', 'Retina RT', 'Retina_RT', 'Retina Rt', 'Retina_Rt', 'Retina_Right', 'retina_R', 'retina_RT', 'right retina', 'retina rt', 'retina_rt', 'retina_right');
structureSetBrain.Add('SpinalCord', 'Spinal Cord', 'spinalcord', 'spinal cord', 'Cord', 'cord');
structureSetBrain.Add('SpinalCord+5mm', 'spinalcord+5mm', 'Spinal Cord+5', 'Cord+5mm', 'cord+5mm', 'Cord PRV', 'cord PRV', 'cord_PRV', 'cord_5', 'cord_5mm', 'SpinalCord_5', 'SpinalCord_5mm', 'spinalcord_5');
structureSetBrain.Add('TemporalLobe', 'Temporal Lobe', 'temporallobe', 'temporalLobe', 'tempLobe');
structureSetBrain.Add('TempLobe_L', 'TempLobe_L', 'TempLobe_LT', 'TempLobe Lt', 'TempLobe_Lt', 'TempLobe_l', 'TempLobe_lt, Temporal_L', 'Temporal_LT', 'Temporal_l', 'Temporal_lt', 'templobe_L', 'templobe_LT', 'templobe_LT', 'templobe_l', 'templobe_lt, temporal_L', 'temporal_LT', 'temporal_l', 'temporal_lt');
structureSetBrain.Add('TempLobe_R', 'TempLobe_R', 'TempLobe_RT', 'TempLobe Rt', 'TempLobe_Rt', 'TempLobe_r', 'TempLobe_rt, Temporal_R', 'Temporal_RT', 'Temporal_r', 'Temporal_rt', 'templobe_R', 'templobe_RT', 'templobe_RT', 'templobe_r', 'templobe_rt, temporal_R', 'temporal_RT', 'temporal_r', 'temporal_rt');
}
}
}