in reply to Re: Text::Context or alternatives?
in thread Text::Context or alternatives?

It looks to me as if $content =~ tr/ / / could be calculated once outside the loop, and be kept in a variable.

Still I find the number of blanks to be a rather dubious metric (what about all those other whitespace characters? Do two blanks in a row still make sense to count double?)

Replies are listed 'Best First'.
Re^3: Text::Context or alternatives?
by Dave Howorth (Scribe) on Nov 09, 2011 at 11:00 UTC
    Yes, I too think it could be calculated outside the loop. But what merit does any statistic of the paragraph have as a score for a match?

      So in summary after doing some more spelunking, I think that Text::Context is buggy and probably unfinished. But nobody's suggested any alternatives. So I'll probably just bodge it until it works for me. I'll post the results to its RT queue.