Labeling double words in a sentence
Hi,
I have some sentences in every row in a column. I would like to detect the same consecutive words. The sample sentence and the one I would like to achieve like below;
This is an example example sentence
This is an example* sentence
Is there a way to do this by Datameer? Thanks
-
Official comment
Hi Tugrul,
Thank you for posting this question. In order to understand the problem statement better, I would like to know if you mean to say that, if there are consecutive words, the next repetitive word should be replaced with a * character?
Comment actions -
Hi Tugrul,
Thanks for the clarifications.
You can use REPLACEALL function to replace all the duplicate words with an output you desire.
Refer more about REPLACEALL:https://documentation.datameer.com/documentation/display/DASSB70/REPLACEALL
Expression : REPLACEALL(#Sheet1!A;"\\b(\\w+)(?:\\s+\\1\\b)+";"$1*")
Regular expression to find the duplicate words in a sentence "\\b(\\w+)(?:\\s+\\1\\b)+".
Here is an Example:
Please let me know if this works for you.
Regards,
Sabeel
Please sign in to leave a comment.
Comments
4 comments