NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

## All the Perl that's Practical to Extract and Report

#### TeeJay (2309)

TeeJay
(email not shown publicly)
http://www.aarontrevena.co.uk/

Working in Truro
Graduate with BSc (Hons) in Computer Systems and Networks
pm : london.pm, bath.pm, devoncornwall.pm
lug : Devon & Cornwall LUG
CPAN : TEEJAY [cpan.org]
irc : TeeJay
skype : hashbangperl
livejournal : hashbangperl [livejournal.com]
flickr :hashbangperl [flickr.com]

### Journal of TeeJay (2309)

Friday February 21, 2003
09:26 AM

### ooh, search engine fun

[ #10724 ]
Cool it looks like I could build a funky vector space search engine using the mysql cosine function.

...that would be quite cool.

Is it just me that thinks that search engine internals are fun?!?

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.

Full
Abbreviated
Hidden
• #### Scalar vs. Vector(Score:2)

Cool it looks like I could build a funky vector space search engine using the mysql cosine function.

Not quite. MySQL has a scalar cosine function, like Perl and damn near every other programming language you can name. Because this is a vector based search engine, you need to take the cosine of the two vectors, as the article clearly states:

The formula for calculating the cosine is this:

cos = ( V1 * V2 ) / ||V1|| x ||V2||

Where V2 and V2 are our vectors, the vertical bars indicate the

• #### Re:Scalar vs. Vector(Score:1)

I guessed it wouldn't be that easy ;)

That confirms my initial concerns that it wouldn't scale well, as you would have to do a lot of mathematical grunt work in Perl (or more likely the C PDL library), as opposed to using a specialised tool like a relational database to the bulk of the processing.

I don't think MySQL would manage the cosine math involved here. Oracle probably would using horrid PL/SQL perversions, but that would subtract rather from the initial elegance.

It would be nice to be able to do

--

@JAPH = qw(Hacker Perl Another Just);
print reverse @JAPH;