I have a word and I want to retrieve a array of aliases that I make for that word. For example I'll have an array ["hello", "hi", "hey", "yo"]. If my word is "hey", then I want to be able to get that entire array. My first idea was to use objects like so:
let aliasdict = {
"hello": ["hello", "hi", "hey", "yo"],
"hi": ["hello", "hi", "hey", "yo],
"hey": ["hello", "hi", "hey", "yo"],
"yo": ["hello", "hi", "hey", "yo"],
}
The catch is that I plan to have over 100 different phrases each with 2-4 different aliases. So it'll be something like this:
let aliasdict = {
"hello": ["hello", "hi", "hey", "yo"],
"hi": ["hello", "hi", "hey", "yo],
"hey": ["hello", "hi", "hey", "yo"],
"yo": ["hello", "hi", "hey", "yo"],
"blue": ["blue", "green", "white"],
"green": ["blue", "green", "white"],
"white": ["blue", "green", "white"],
"head": ["head", "knees", "tail"],
...
...
}
The amount of copy-pasting needed leaves me with some distaste so I want to ask if there is a simpler solution without copy-pasting so much and without detracting from the speed of using dictionaries.
Thanks.