Also, the user wants the output to be only the text with the rephrased words. So the formatted output should be a single line with the rephrased words in the correct format. For example, input "I love dogs" would become I|cherish|pups assuming those are the synonyms.
In summary, the steps are:
Another consideration: punctuation. Should I include punctuation within the brackets? For example, if a word is followed by a comma, does the comma stay? The user didn't mention handling punctuation, but typically, in natural language processing tasks, punctuation is stripped or handled separately. However, the user's instruction is to rephrase every word with synonyms, so maybe punctuation remains as is, and only the words are rephrased.
I need to process the input text. Let me check if there's any text provided. The user's input text is just a newline. So perhaps the actual task is for a non-empty text. Maybe the user made a mistake in the example.
Another edge case: words with multiple meanings. For example, "bank" can be a river bank or a financial institution. How to choose the correct synonym? Without context, it's hard to determine. So the synonym selection might not be accurate in all cases. The user might be aware of this, but it's part of the task.
output
Wait, the user's instruction is straightforward: "Proper nouns stay. Only output text." So perhaps I don't need to detect proper nouns, but the user will ensure that in their input? Maybe they just want all words that are proper nouns to remain as they are. For example, if the input text is "I visited Paris last week", then "Paris" is a proper noun and remains, while "visited" becomes toured.