The function applies to all words that appear in the script, but it does not hold for words that are not in the script. If a word is not in the script, the function will not produce a valid output.

Is there anything else I can help with?