searching/grepping for words "near" each other

Dan Jenkins dan at rastech.com
Fri May 1 00:20:14 EDT 2009


VirginSnow at vfemail.net wrote:
> > From: kevin_d_clark at comcast.net (Kevin D. Clark) Date: 30 Apr 2009
> > 12:02:19 -0400
> >> I want to search a text file for a few (alphabetic) words which
> >> must be "near" each other, but not necessarily on the same line.
> >> "Near" could be defined however you like... within a certain
> >> number of words from each other, a certain number of charecters
> >> from each other, or some similar constraint.

I believe this is often called a "proximity search." I did write some 
code to do it three decades ago in Lisp. I don't recollect where I 
gleaned the algorithm though.



More information about the gnhlug-discuss mailing list