View Single Post
  #4   Report Post  
Posted to microsoft.public.word.newusers
Frank Martin Frank Martin is offline
external usenet poster
 
Posts: 49
Default Finding duplicate phrases and paragraphs.


"Klaus Linke" wrote in message
...
"Frank Martin" wrote:
I am copying a rare particular story from many different
newsgroups and pasting the fragments into a Word2003
document.

Is there some way to automatically find duplicated
sections of the story to as to help weld it into one
seamless whole?

In the spell checker one can easily do this for
duplicated words, but I need the same thing for
duplicated strings, and even sentences.



Hi Frank,

For repeated paragraphs, you could try a wildcard search
for

(^13[!^13]@^13)*\1

If a repeated paragraph is found, you'll see it at the
start and end of the selection... though there needs to be
at least one paragraph in between.
For repeated paragraphs right next to each other, you
could use

^13([!^13]@^13)\1


For repeated sentences or other duplicated strings of some
length, you'd need a more complicated macro.
You could read the whole document into a string. You
probably can find algorithms for finding repeated phrases
in the string using Google:
http://en.wikipedia.org/wiki/Longest...string_problem

Regards,
Klaus



Thank you. I could not get this to work, but I have found a
site with worked examples in word.
http://www.tutorials-win.com/archive/WordDoc/
Is there any way to search this archive for a specific
example?
Frank