Is it possible to change the word order of a phrase by creating a list of possible values/variables and using the Sort function?
I want a specific word order always. $(a>b>c>d)$ But the values represented will change example to example. Associations may be what I'm actually trying to create, I'm not sure of the correct term.
Some examples of variables/associations:
a={"Left" or "Right" or "Top" or "Bottom"}
b={"Red" or "Blue" or "Green" or "Yellow"}
c={"Closing" or "Rolling" or "Running" or "Cleaning"}
d={"Paper" or "Note" or "Cat" or "Dog"}
Then I want to create a function:
neworder=Sort[a,b,c,d]
Then apply the function to a phrase (that has already been StringSplit):
neworder["Running","Dog","Blue"]
out = {"Blue","Running","Dog"}
Another example:
neworder["Red","Paper","Cleaning","Top"]
out = {"Top","Red","Cleaning","Paper"}
Is it possible to us Sort/SortBy in this manner? I know there are a few options in the way Sort works, but hadn't seen this method before. (Sorting a phrase by WordData, "PartsOfSpeech" is also on my radar, because that is essentially how I'm defining my variables/associations.)