./textproc/p5-Text-Context-EitherSide, Get n words either side of search keywords

[ CVSweb ] [ Homepage ] [ RSS ] [ Required by ] [ Add to tracker ]


Branch: pkgsrc-2009Q1, Version: 1.3nb1, Package name: p5-Text-Context-EitherSide-1.3nb1, Maintainer: pkgsrc-users

Suppose you have a large piece of text - typically, say, a web page or
a mail message. And now suppose you've done some kind of full-text
search on that text for a bunch of keywords, and you want to display
the context in which you found the keywords inside the body of the
text.

A simple-minded way to do that would be just to get the two words
either side of each keyword. But hey, don't be too simple minded,
because you've got to make sure that the list doesn't overlap. If you
have

the quick brown fox jumped over the lazy dog

and you extract two words either side of ``fox'', ``jumped'' and
``dog'', you really don't want to end up with

quick brown fox jumped over brown fox jumped over the the lazy dog

so you need a small amount of smarts. This module has a small amount
of smarts.


Required to run:
[lang/perl5]

Master sites: (Expand)

SHA1: 3172207854b255f38237f08b7f5a96523330a969
RMD160: 40b2ef19b115f1dbec63550c28cc850d7fd24d64
Filesize: 4.582 KB

Version history: (Expand)