You are probably wondering how this program works... here is the main trick and a secret that it uses.
First, it reads two consecutive sentences A and B from an input document.
Second, it looks within all documents for a sentence that has the closest meaning to a sentence A, lets call it A'. When found, document D is memorised.
Third, it looks for the sentence in document D after the sentence A' that has the closest meaning to a sentence B. Lets call it B'
Fourth, a summary between A' and B' is calculated and then inserted in between A and B as an expanded text.
-Sounds simple enough?
Yes it is simple, however the background work is not simple at all. There are different approaches that can be used, however, this was the fastest I could come up with...