I can’t thank you enough for your detailed response! I apologize if I am asking too much of this forum, but given I have this question I am sure others would benefit from an answer as well.
While on this topic, I wonder what steps would need to be taken to expand this function for the output to include phrases in addition to words.