I have a set of suggestions that I need to use to replace, for example:
abc => cde ab df => de ...
And I have a text where you can make changes. However, I have no way to know in advance the case with the specified text. So, for example, if I have:
A bgt abc hyi. Abc Ab df h
I have to replace and get:
A bgt cde nyi. Cde De h
Or as close to this as possible, i.e. save case
EDIT: As I see a lot of confusion about this, I will try to clarify a bit:
I ask how to save capital letters after replacement, and I donβt think it went well (itβs not clear what it entails), so Iβll give a more realistic example using real words.
think of it as words, replacing the expressions with your synonyms, so to speak, so if I match:
didn't achieve success => failled miserably
then I get the value as input:
As he didn't achieve success, he was fired
i would get
As he failled miserably, he was fired
but if it had not been capitalized, then it would have been refuted, if success or success had been capitalized, it would have been a pity if someone had more than 1 capital letters, so it would have been like
My main features (the ones that I really want to use in cosideration)
- only the first letter of the first word, capital letter
- only the first letter of each word with a capital letter
- all capital letters
If I can handle those three that are compatible already, I think - these are simpler - of course, a deeper solution would be better if aviillable
Any ideas?