It was a bit of a pain to get the LSI classifier feature of jekyll to work with rb-gsl. The gem doesn’t work and there’s a bug in the classifier gem. Here’s what I did to get it working:
- Check out the latest rb-gsl from svn:
svn checkout svn://rubyforge.org/var/svn/rb-gsl/trunk - Build and install that (simple instructions in the README)
- Install the
classifiergem - Change the
classifier-1.3.1/lib/classifier/lsi.rbfile from this
Around line 290:
def build_reduced_matrix( matrix, cutoff=0.75 )
# ...
# Reconstruct the term document matrix, only with reduced rank
u * Matrix.diag( s ) * v.trans
end
To this:
def build_reduced_matrix( matrix, cutoff=0.75 )
# ...
# Reconstruct the term document matrix, only with reduced rank
if $GSL
u * GSL::Matrix.diag( s ) * v.trans
else
u * Matrix.diag( s ) * v.trans
end
end
Without rb-gsl, the jekyll lsi classifier is way, way too slow to use after you get more than a handful of posts.