Description Usage Arguments Warnings Examples
Return the indexes of common and different elements of two texts.
1 | getDiffTexts(a.text, b.text, sep = " ")
|
a.text, |
a string to compare. |
b.text, |
another string to compare. |
sep, |
short string containing separator. We will use this string to split texts into smaller pieces. " " would split texts into words and "\." would split texts into sentences. |
geDiffTexts uses LCS algortihm to compute differences between two texts. If texts are considerably long be aware that this implementation of LCS is O(n^2) expensive, both time and memory wise, so it is recommended to use sep = "\." to speed up the execution.
1 2 3 | text.1 <- "Lorem ipsum dolor sit amet, consectetur adipiscing elit. Pellentesque nec vehicula purus. Praesent vehicula risus a purus sollicitudin cursus. Nullam hendrerit efficitur gravida. Sed ut quam a urna sollicitudin dapibus. Integer vitae ultricies sapien, eu tincidunt lacus. Suspendisse eget dapibus diam."
text.2 <- "Nullam hendrerit efficitur gravida. Sed ut quam a urna sollicitudin dapibus. Integer vitae ultricies sapien, eu tincidunt lacus. Pellentesque sed dui turpis."
getDiffTexts(text.1, text.2)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.