Hi -- On Fri, 17 Mar 2006, thoran / thoran.com wrote: > Hello Again Good Folk of Rubydom, > > I was searching for a library in Ruby which I wasn't sure existed, and > sometimes I'll go looking to see if Perl has something. (And when > doesn't it?) When I find that something in Perl it'll often lead me to > something that does exist in Ruby because of a re-implementation which > has the same name or makes reference to the Perl version as its > inspiration, such as was the case with Mechanize recently. > > Anyhow whilst doing so, I came across this file: > http://search.cpan.org/src/SIMON/Acme-OneHundredNotOut-100/OneHundredNotOut.pm, > which contains this little gem: > > "You know those little snippets that Google and other search engines > display when you > search for some terms? They contextualise the terms in the body of the > document and highlight them in a snippet that best represents how > they're used in the document. This is actually a really hard problem, > and it took me several goes to get L<Text::Context> right. It uses > L<Text::Context::EitherSide> as an "emergency" contextualizer if it > can't get anything right at all, but the algorithm itself is a bit of a > swine. > > <paragraph continues, but separated for emphasis> > > "I actually had to prototype this module in Ruby to get my > thinking clear enough to code it up in Perl..." > > Does this seem a little muddle-headed to anyone!? Maybe I still haven't had enough caffeine... but it doesn't sound muddle-headed to me. I'm actually not sure what aspect of it you mean. I certainly wouldn't second-guess Simon Cozens, who has written more than 100 Perl modules, if that's how he felt he wanted to proceed. David -- David A. Black (dblack / wobblini.net) Ruby Power and Light, LLC (http://www.rubypowerandlight.com) "Ruby for Rails" chapters now available from Manning Early Access Program! http://www.manning.com/books/black